From 0f1aa8505bd058491226324a7166399d5eb33cb1 Mon Sep 17 00:00:00 2001 From: Cao T Date: Tue, 3 Jul 2018 12:18:03 -0400 Subject: [PATCH] Update inception.py check if cls in self._cls_to_uid --- inception.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/inception.py b/inception.py index 6194c5b..58cd0cd 100644 --- a/inception.py +++ b/inception.py @@ -209,12 +209,12 @@ def cls_to_name(self, cls, only_first_name=False): """ # Lookup the uid from the cls. - uid = self._cls_to_uid[cls] + if cls in self._cls_to_uid: + uid = self._cls_to_uid[cls] - # Lookup the name from the uid. - name = self.uid_to_name(uid=uid, only_first_name=only_first_name) - - return name + # Lookup the name from the uid. + name = self.uid_to_name(uid=uid, only_first_name=only_first_name) + return name ########################################################################