JAL-1332 make SSM context discovery safer (particularly in plugin context)
authorJim Procter <jprocter@compbio.dundee.ac.uk>
Sun, 7 Jul 2013 11:42:59 +0000 (12:42 +0100)
committerJim Procter <jprocter@compbio.dundee.ac.uk>
Sun, 7 Jul 2013 11:43:39 +0000 (12:43 +0100)
src/jalview/structure/StructureSelectionManager.java

index e598120..7415712 100644 (file)
@@ -57,6 +57,10 @@ public class StructureSelectionManager
   public static StructureSelectionManager getStructureSelectionManager(
           StructureSelectionManagerProvider context)
   {
+    if (context==null)
+    {
+      throw new Error("Implementation error. Structure selection manager's context is 'null'", new NullPointerException("SSM context is null"));
+    }
     if (instances == null)
     {
       instances = new java.util.IdentityHashMap<StructureSelectionManagerProvider, StructureSelectionManager>();