JAL-3048 attempt to catch Object(NaN) … probably doesn’t work!
authorJim Procter <jprocter@issues.jalview.org>
Mon, 2 Jul 2018 16:36:07 +0000 (17:36 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Mon, 2 Jul 2018 16:36:07 +0000 (17:36 +0100)
src/jalview/util/dialogrunner/DialogRunner.java

index b631128..fc99b2d 100644 (file)
@@ -157,6 +157,12 @@ public class DialogRunner<T extends DialogRunnerI> implements DialogRunnerI
 
   public void firstRun(Object responseObj)
   {
+    if (responseObj != null && !responseObj.equals(responseObj))
+    {
+      // NaN is an object in Chrome - catch this weirdness
+      // this so we don't cause issues later
+      return;
+    }
     doFirstRun(new Response(responseObj));
   }
 
@@ -175,6 +181,13 @@ public class DialogRunner<T extends DialogRunnerI> implements DialogRunnerI
 
   private void run(Response response)
   {
+    if (response.objresp != null
+            && !response.objresp.equals(response.objresp))
+    {
+      // NaN is an object in Chrome - catch this weirdness
+      // this so we don't cause issues later
+      return;
+    }
     responses.add(response);
     List<RunResponse> laction = callbacks.get(response);