Browse Source

avoid overiding of entries for atom data

JonStargaryen 4 years ago
parent
commit
b4ff98499b
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/mol-model-formats/structure/property/atoms/chem_comp.ts

+ 5 - 1
src/mol-model-formats/structure/property/atoms/chem_comp.ts

@@ -56,7 +56,11 @@ export namespace ComponentAtom {
         const entries: Map<string, Entry> = new Map();
 
         function addEntry(id: string) {
-            let e = new Entry(id);
+            // weird behavior when 'PRO' is requested - will report a single bond between N and H because a later operation would override real content
+            if (entries.has(id)) {
+                return entries.get(id)!;
+            }
+            const e = new Entry(id);
             entries.set(id, e);
             return e;
         }