From d6bd40496a2168ccd775ff529f26af719f9d4ccc Mon Sep 17 00:00:00 2001 From: Anthony Garcia Date: Sun, 1 Mar 2015 10:32:29 -0700 Subject: [PATCH] Attempt to handle missing attr descs more gracefully --- steam/items.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/steam/items.py b/steam/items.py index ebb20d3..d25122e 100644 --- a/steam/items.py +++ b/steam/items.py @@ -122,7 +122,12 @@ def _attribute_definition(self, attrid): return dict(attrs[attrid]) except KeyError: attr_names = self._schema["attribute_names"] - return dict(attrs.get(attr_names.get(str(attrid).lower()))) or None + attrdef = attrs.get(attr_names.get(str(attrid).lower())) + + if not attrdef: + return None + else: + return dict(attrdef) def _quality_definition(self, qid): """ Returns the ID and localized name of the given quality, can be either ID type """