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 ########################################################################