From 123d6abedec02ca710b508789bd74e6e4b6bdb69 Mon Sep 17 00:00:00 2001
From: Alexander Rose <alexander.rose@weirdbyte.de>
Date: Fri, 15 Jun 2018 11:41:32 +0200
Subject: [PATCH] fixed StructureRepresentation.getLoci

---
 src/mol-geo/representation/structure/index.ts | 4 ++--
 src/mol-view/label.ts                         | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/mol-geo/representation/structure/index.ts b/src/mol-geo/representation/structure/index.ts
index 4716fc2c4..968950ec9 100644
--- a/src/mol-geo/representation/structure/index.ts
+++ b/src/mol-geo/representation/structure/index.ts
@@ -11,7 +11,7 @@ import { RenderObject } from 'mol-gl/render-object';
 import { Representation, RepresentationProps } from '..';
 import { ColorTheme } from '../../theme';
 import { PickingId } from '../../util/picking';
-import { Loci, EmptyLoci } from 'mol-model/loci';
+import { Loci, EmptyLoci, isEmptyLoci } from 'mol-model/loci';
 import { MarkerAction } from '../../util/marker-data';
 
 export interface UnitsRepresentation<P> {
@@ -47,7 +47,7 @@ export function StructureRepresentation<P extends StructureProps>(reprCtor: () =
     function getLoci(pickingId: PickingId) {
         for (let i = 0, il = groupReprs.length; i < il; ++i) {
             const loc = groupReprs[i].repr.getLoci(pickingId)
-            if (loc) return loc
+            if (!isEmptyLoci(loc)) return loc
         }
         return EmptyLoci
     }
diff --git a/src/mol-view/label.ts b/src/mol-view/label.ts
index ddb518bd6..da98fa3b7 100644
--- a/src/mol-view/label.ts
+++ b/src/mol-view/label.ts
@@ -23,7 +23,7 @@ export function labelFirst(loci: Loci): string {
             if (e && e.indices[0] !== undefined) {
                 return elementLabel(Element.Location(e.unit, e.indices[0]))
             } else {
-                return 'Nothing'
+                return 'Unknown'
             }
         case 'link-loci':
             const bond = loci.links[0]
@@ -32,10 +32,10 @@ export function labelFirst(loci: Loci): string {
                 setElementLocation(elementLocB, bond.bUnit, bond.bIndex)
                 return `${elementLabel(elementLocA)} - ${elementLabel(elementLocB)}`
             } else {
-                return 'Nothing'
+                return 'Unknown'
             }
         case 'every-loci':
-            return 'Evertything'
+            return 'Everything'
         case 'empty-loci':
             return 'Nothing'
     }
-- 
GitLab