JAL-629 null check, fixed tests!
[jalview.git] / src / jalview / bin / Commands.java
index 4239ec7..552dda6 100644 (file)
@@ -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);
+        }
       }
     }
   }