Browse Source

fix FormatRegistry.isApplicable

- was returning true for unregistered formats
Alexander Rose 2 years ago
parent
commit
3c21fcd53a
2 changed files with 2 additions and 0 deletions
  1. 1 0
      CHANGELOG.md
  2. 1 0
      src/mol-model-formats/structure/common/property.ts

+ 1 - 0
CHANGELOG.md

@@ -7,6 +7,7 @@ Note that since we don't clearly distinguish between a public and private interf
 ## [Unreleased]
 
 - Fix case handling of ``struct_conf`` mmCIF enumeration field (#425)
+- Fix ``FormatRegistry.isApplicable`` returning true for unregistered formats
 
 ## [v3.7.0] - 2022-04-13
 

+ 1 - 0
src/mol-model-formats/structure/common/property.ts

@@ -28,6 +28,7 @@ class FormatRegistry<T> {
     }
 
     isApplicable(model: Model) {
+        if (!this.map.has(model.sourceData.kind)) return false;
         const isApplicable = this.applicable.get(model.sourceData.kind);
         return isApplicable ? isApplicable(model) : true;
     }