Skip to content

Commit

Permalink
Attempt to handle missing attr descs more gracefully
Browse files Browse the repository at this point in the history
  • Loading branch information
Lagg committed Mar 1, 2015
1 parent cab74a3 commit d6bd404
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion steam/items.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 """
Expand Down

0 comments on commit d6bd404

Please sign in to comment.