From 49c595b1a5d841a27e6c01367da99d278152b976 Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Fri, 18 Aug 2023 10:03:13 +0100 Subject: [PATCH] JAL-4242 null check on getValue() return --- src/jalview/gui/JvOptionPane.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/jalview/gui/JvOptionPane.java b/src/jalview/gui/JvOptionPane.java index c0efd4a..e622445 100644 --- a/src/jalview/gui/JvOptionPane.java +++ b/src/jalview/gui/JvOptionPane.java @@ -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()) -- 1.7.10.2