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: Release_2_11_4_0~45^2~18^2~603^2~2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=95895d6f4c575d2af751bc46c172277ca0de1d31;p=jalview.git 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);