Skip to content

Commit

Permalink
fix closeIfOpen() crash when panel is not open
Browse files Browse the repository at this point in the history
  • Loading branch information
brachy84 committed Sep 7, 2024
1 parent 3e92111 commit 80f45ac
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,13 @@ public boolean isOpen() {
* @param animate true if the closing animation should play first.
*/
public void closeIfOpen(boolean animate) {
if (!isOpen()) return;
closeSubPanels();
if (!animate || !shouldAnimate()) {
this.screen.getPanelManager().closePanel(this);
return;
}
if (isOpen() && !isOpening() && !isClosing()) {
if (!isOpening() && !isClosing()) {
if (isMainPanel()) {
// if this is the main panel, start closing animation for all panels
for (ModularPanel panel : getScreen().getPanelManager().getOpenPanels()) {
Expand Down

0 comments on commit 80f45ac

Please sign in to comment.