From 5b4178176ac4c475cd41f35879ac309bfe874d5f Mon Sep 17 00:00:00 2001 From: Joel Uckelman Date: Thu, 14 Sep 2023 00:56:12 +0100 Subject: [PATCH] Check that editorWindow is nonnull before trying to use it. --- .../java/VASSAL/configure/ConfigureTree.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/vassal-app/src/main/java/VASSAL/configure/ConfigureTree.java b/vassal-app/src/main/java/VASSAL/configure/ConfigureTree.java index daa8fccd63..29e71a21e8 100644 --- a/vassal-app/src/main/java/VASSAL/configure/ConfigureTree.java +++ b/vassal-app/src/main/java/VASSAL/configure/ConfigureTree.java @@ -625,17 +625,21 @@ private List getSearchNodes(DefaultMutableTreeNode root) private void notifyUpdate(final Configurable target) { - if (target instanceof AbstractConfigurable) { - if (editorWindow.getListKeyCommands() != null) { - editorWindow.getListKeyCommands().updateConfigurable((AbstractConfigurable)target); + if (editorWindow != null) { + if (target instanceof AbstractConfigurable) { + if (editorWindow.getListKeyCommands() != null) { + editorWindow.getListKeyCommands().updateConfigurable((AbstractConfigurable)target); + } } } } private void notifyDelete(final Configurable target) { - if (target instanceof AbstractConfigurable) { - if (editorWindow.getListKeyCommands() != null) { - editorWindow.getListKeyCommands().deleteConfigurable((AbstractConfigurable)target); + if (editorWindow != null) { + if (target instanceof AbstractConfigurable) { + if (editorWindow.getListKeyCommands() != null) { + editorWindow.getListKeyCommands().deleteConfigurable((AbstractConfigurable)target); + } } } }