mirror of
https://github.com/badvision/lawless-legends.git
synced 2025-08-06 09:25:06 +00:00
Fixed null pointer errors when switching and deleting maps and images
This commit is contained in:
@@ -216,8 +216,6 @@ public class ImageEditorTabControllerImpl extends ImageEditorTabController {
|
||||
imageNameField.setDisable(true);
|
||||
imageWidthField.setDisable(true);
|
||||
currentImageEditor = null;
|
||||
cursorInfo.textProperty().unbind();
|
||||
cursorInfo.setText("");
|
||||
} else {
|
||||
if (i.getName() == null) {
|
||||
i.setName("Untitled");
|
||||
@@ -248,7 +246,12 @@ public class ImageEditorTabControllerImpl extends ImageEditorTabController {
|
||||
currentImageEditor.setState(oldEditorState);
|
||||
}
|
||||
}
|
||||
cursorInfo.textProperty().bind(currentImageEditor.cursorInfoProperty());
|
||||
if (currentImageEditor != null) {
|
||||
cursorInfo.textProperty().bind(currentImageEditor.cursorInfoProperty());
|
||||
} else {
|
||||
cursorInfo.textProperty().unbind();
|
||||
cursorInfo.setText("");
|
||||
}
|
||||
}
|
||||
|
||||
private Image getCurrentImage() {
|
||||
|
@@ -286,8 +286,6 @@ public class MapEditorTabControllerImpl extends MapEditorTabController {
|
||||
mapWidthField.setDisable(true);
|
||||
mapWrapAround.setDisable(true);
|
||||
setCurrentEditor(null);
|
||||
cursorInfo.textProperty().unbind();
|
||||
cursorInfo.setText("");
|
||||
} else {
|
||||
if (m.getScripts() != null) {
|
||||
DataUtilities.sortNamedEntities(m.getScripts().getScript());
|
||||
@@ -323,7 +321,12 @@ public class MapEditorTabControllerImpl extends MapEditorTabController {
|
||||
if (currentTile != null) {
|
||||
e.setCurrentTile(currentTile);
|
||||
}
|
||||
cursorInfo.textProperty().bind(e.cursorInfoProperty());
|
||||
}
|
||||
if (getCurrentEditor() != null) {
|
||||
cursorInfo.textProperty().bind(getCurrentEditor().cursorInfoProperty());
|
||||
} else {
|
||||
cursorInfo.textProperty().unbind();
|
||||
cursorInfo.setText("");
|
||||
}
|
||||
redrawMapScripts();
|
||||
}
|
||||
|
Reference in New Issue
Block a user