Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

12411 - Fixed NPE when updating ConfigureTree #12692

Merged
merged 2 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import VASSAL.tools.ScrollPane;
import VASSAL.tools.swing.SwingUtils;

import javax.swing.Action;
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JButton;
Expand Down Expand Up @@ -61,6 +62,11 @@ public void mousePressed(MouseEvent e) {
@Override
public void mouseReleased(MouseEvent e) {
}

@Override
protected Action buildEditAction(Configurable target) {
return null;
}
};
tree.addTreeSelectionListener(this);
add(new ScrollPane(tree));
Expand Down
16 changes: 10 additions & 6 deletions vassal-app/src/main/java/VASSAL/configure/ConfigureTree.java
Original file line number Diff line number Diff line change
Expand Up @@ -625,17 +625,21 @@ private List<DefaultMutableTreeNode> 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);
}
}
}
}
Expand Down