From fa027754c7e626c3811b0888e091837c7ab3bdd1 Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Fri, 9 Dec 2022 13:05:10 +0000 Subject: [PATCH] JAL-629 null check, fixed tests! --- src/jalview/bin/Commands.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/jalview/bin/Commands.java b/src/jalview/bin/Commands.java index 4239ec7..552dda6 100644 --- a/src/jalview/bin/Commands.java +++ b/src/jalview/bin/Commands.java @@ -42,16 +42,19 @@ public class Commands { argParser = ap; headless = h; - for (String id : argParser.linkedIds()) + if (argParser != null && argParser.linkedIds() != null) { - Commands cmds = new Commands(); - if (id == null) + for (String id : argParser.linkedIds()) { - cmds.processUnlinked(id); - } - else - { - cmds.processLinked(id); + Commands cmds = new Commands(); + if (id == null) + { + cmds.processUnlinked(id); + } + else + { + cmds.processLinked(id); + } } } } -- 1.7.10.2