JAL-1332 make SSM context discovery safer (particularly in plugin context)
[jalview.git] / 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>();