From: Jim Procter Date: Mon, 2 Jul 2018 16:36:07 +0000 (+0100) Subject: JAL-3048 attempt to catch Object(NaN) … probably doesn’t work! X-Git-Tag: Develop-2_11_2_0-d20201215~24^2~68^2~603^2~2 X-Git-Url: http://source.jalview.org/gitweb/?p=jalview.git;a=commitdiff_plain;h=95895d6f4c575d2af751bc46c172277ca0de1d31 JAL-3048 attempt to catch Object(NaN) … probably doesn’t work! --- diff --git a/src/jalview/util/dialogrunner/DialogRunner.java b/src/jalview/util/dialogrunner/DialogRunner.java index b631128..fc99b2d 100644 --- a/src/jalview/util/dialogrunner/DialogRunner.java +++ b/src/jalview/util/dialogrunner/DialogRunner.java @@ -157,6 +157,12 @@ public class DialogRunner 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 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 laction = callbacks.get(response);