Skip to content

Commit

Permalink
Handle bad TODO dialog cases better
Browse files Browse the repository at this point in the history
Signed-off-by: Taylor Smock <[email protected]>
  • Loading branch information
tsmock committed Nov 7, 2024
1 parent e6a52ff commit 0c09bc7
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,16 @@ public static void addTodoItems() {
return;
}
final ToggleDialog todoDialog = MainApplication.getMap().getToggleDialog(CLASS);
if (todoDialog == null) {
return;
}
try {
AbstractListModel<?> m = (AbstractListModel<?>) MODEL.get(todoDialog);
if (m.getSize() == 0) {
if (m != null && m.getSize() == 0) {
JosmAction a = (JosmAction) ACT_ADD.get(todoDialog);
a.actionPerformed(null);
if (a != null) {
a.actionPerformed(null);
}
}
} catch (ReflectiveOperationException e) {
Logging.error(e);
Expand Down

0 comments on commit 0c09bc7

Please sign in to comment.