From 244c7f3f09b99ee3ebbd22733177c6479d07b13d Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Thu, 30 Mar 2023 09:34:55 +0100 Subject: [PATCH] JAL-629 fix SubVals npe --- src/jalview/bin/argparser/ArgParser.java | 3 +-- src/jalview/bin/argparser/SubVals.java | 8 ++++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/jalview/bin/argparser/ArgParser.java b/src/jalview/bin/argparser/ArgParser.java index 19cf276..e58bcb5 100644 --- a/src/jalview/bin/argparser/ArgParser.java +++ b/src/jalview/bin/argparser/ArgParser.java @@ -360,8 +360,7 @@ public class ArgParser for (String v : globVals) { v = makeSubstitutions(v); - SubVals vsv = new SubVals(globSubVals == null ? null - : globSubVals.getSubValsMap(), v); + SubVals vsv = new SubVals(globSubVals, v); avs.addValue(vsv, v, argIndex++); argIndexIncremented = true; } diff --git a/src/jalview/bin/argparser/SubVals.java b/src/jalview/bin/argparser/SubVals.java index aea6df3..dd20ca6 100644 --- a/src/jalview/bin/argparser/SubVals.java +++ b/src/jalview/bin/argparser/SubVals.java @@ -27,9 +27,13 @@ public class SubVals private String content = null; - public SubVals(Map sv, String c) + public SubVals(SubVals sv, String c) { - this.subVals = sv; + if (sv != null) + { + this.subVals = sv.getSubValsMap(); + this.index = sv.getIndex(); + } this.content = c; } -- 1.7.10.2