소스 검색

only add interunit bon entry if there are bonds

Alexander Rose 6 년 전
부모
커밋
7c352d8121
1개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 4 2
      src/mol-model/structure/structure/unit/links/inter-compute.ts

+ 4 - 2
src/mol-model/structure/structure/unit/links/inter-compute.ts

@@ -139,8 +139,10 @@ function findPairLinks(unitA: Unit.Atomic, unitB: Unit.Atomic, params: LinkCompu
         }
     }
 
-    addMapEntry(map, unitA.id, new InterUnitBonds.UnitPairBonds(unitA, unitB, bondCount, state.bondedA.array, state.mapAB));
-    addMapEntry(map, unitB.id, new InterUnitBonds.UnitPairBonds(unitB, unitA, bondCount, state.bondedB.array, state.mapBA));
+    if (bondCount) {
+        addMapEntry(map, unitA.id, new InterUnitBonds.UnitPairBonds(unitA, unitB, bondCount, state.bondedA.array, state.mapAB));
+        addMapEntry(map, unitB.id, new InterUnitBonds.UnitPairBonds(unitB, unitA, bondCount, state.bondedB.array, state.mapBA));
+    }
 
     return bondCount;
 }