Fixed: Exceptions when closing non-ribbon window

This commit is contained in:
Jindra Petřík
2025-05-08 09:45:13 +02:00
parent 902c7a556e
commit 60a50047b9
2 changed files with 10 additions and 0 deletions
@@ -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);