From c708b0d5bed26752c34e62960f0acdeada8742df Mon Sep 17 00:00:00 2001 From: gmungoc Date: Tue, 30 Aug 2016 15:58:47 +0100 Subject: [PATCH] JAL-2183 defensive check for openFrameCount < 0 (shouldn't happen but did) --- src/jalview/gui/Desktop.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java index 7811e41..3cc2c14 100644 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@ -825,7 +825,15 @@ public class Desktop extends jalview.jbgui.GDesktop implements javax.swing.event.InternalFrameEvent evt) { PaintRefresher.RemoveComponent(frame); - openFrameCount--; + + /* + * defensive check to prevent frames being + * added half off the window + */ + if (openFrameCount > 0) + { + openFrameCount--; + } windowMenu.remove(menuItem); JInternalFrame itf = desktop.getSelectedFrame(); if (itf != null) -- 1.7.10.2