From 60a50047b926eaa30d7f4ff62015398500b32d25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Thu, 8 May 2025 09:45:13 +0200 Subject: [PATCH] Fixed: Exceptions when closing non-ribbon window --- CHANGELOG.md | 1 + .../jpexs/decompiler/flash/gui/MainFrameClassicMenu.java | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5dea67207..40c0b374c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -58,6 +58,7 @@ All notable changes to this project will be documented in this file. - AS 1/2 - Remembering caret position for frames - Cleaner file association - Editing shape points / transform when first edge has no moveTo flag (coordinates 0, 0) +- Exceptions when closing non-ribbon window ### Removed - Windows installer does not associate SWF files anymore as it caused false positives on some AVs. diff --git a/src/com/jpexs/decompiler/flash/gui/MainFrameClassicMenu.java b/src/com/jpexs/decompiler/flash/gui/MainFrameClassicMenu.java index b16769dba..fac106a30 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainFrameClassicMenu.java +++ b/src/com/jpexs/decompiler/flash/gui/MainFrameClassicMenu.java @@ -218,6 +218,9 @@ public class MainFrameClassicMenu extends MainFrameMenu { if (path.equals("_") || path.startsWith("_/")) { return; } + if (menuElements == null) { + return; + } MenuElement menu = menuElements.get(path); if (menu == null) { throw new IllegalArgumentException("Menu " + path + " does not exist"); @@ -252,6 +255,9 @@ public class MainFrameClassicMenu extends MainFrameMenu { @Override public void setMenuChecked(String path, boolean checked) { path = mapping(path); + if (menuElements == null) { + return; + } MenuElement menu = menuElements.get(path); if (menu == null) { throw new IllegalArgumentException("Menu " + path + " does not exist"); @@ -372,6 +378,9 @@ public class MainFrameClassicMenu extends MainFrameMenu { @Override public void setPathVisible(String path, boolean val) { + if (menuElements == null) { + return; + } MenuElement me = menuElements.get(path); if (me instanceof JComponent) { ((JComponent) me).setVisible(val);