JAL-4242 null check on getValue() return
[jalview.git] / src / jalview / gui / JvOptionPane.java
index c0efd4a..e622445 100644 (file)
@@ -1129,7 +1129,13 @@ public class JvOptionPane extends JOptionPane
 
   private void internalDialogHandleResponse()
   {
-    String responseString = (String) this.getValue();
+    Object value = this.getValue();
+    if (value == null
+            || (value instanceof Integer && (Integer) value == -1))
+    {
+      return;
+    }
+    String responseString = value.toString();
     int response = ourOptions.indexOf(responseString);
 
     if (!Platform.isJS())