Merge branch 'bug/JAL-4214_system_freeze_when_opening_file_using_gui_in_linux' into...
[jalview.git] / src / jalview / gui / JvOptionPane.java
index 90d812c..5b926c3 100644 (file)
@@ -722,7 +722,7 @@ public class JvOptionPane extends JOptionPane
 
   private static void outputMessage(Object message)
   {
-    System.out.println(">>> JOption Message : " + message.toString());
+    jalview.bin.Console.outPrintln(">>> JOption Message : " + message.toString());
   }
 
   public static Object getMockResponse()
@@ -1141,7 +1141,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())