JAL-3551 null pointer defence while structure files loading; comments
[jalview.git] / src / jalview / structures / models / AAStructureBindingModel.java
index dcd6da8..5949847 100644 (file)
@@ -1855,4 +1855,17 @@ public abstract class AAStructureBindingModel
       }
     }
   }
+
+  /**
+   * Returns the number of structure files in the structure viewer and mapped to
+   * Jalview. This may be zero if the files are still in the process of loading
+   * in the viewer.
+   * 
+   * @return
+   */
+  public int getMappedStructureCount()
+  {
+    String[] files = getStructureFiles();
+    return files == null ? 0 : files.length;
+  }
 }