From: gmungoc Date: Tue, 30 Aug 2016 14:58:47 +0000 (+0100) Subject: JAL-2183 defensive check for openFrameCount < 0 (shouldn't happen but X-Git-Tag: Release_2_10_0~63 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=c708b0d5bed26752c34e62960f0acdeada8742df;p=jalview.git JAL-2183 defensive check for openFrameCount < 0 (shouldn't happen but did) --- 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)