mirror of
https://github.com/badvision/lawless-legends.git
synced 2024-06-26 00:29:30 +00:00
Fixed null pointer errors when switching and deleting maps and images
This commit is contained in:
parent
11a9640e26
commit
cfb26b86b0
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user