Skip to content

Commit

Permalink
Handle missing attr defs gracefully
Browse files Browse the repository at this point in the history
  • Loading branch information
Lagg committed Mar 1, 2015
1 parent d6bd404 commit 2d5ade2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions steam/items.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,8 @@ def __init__(self, item, schema=None):

if schema:
attrdef = schema._attribute_definition(index)
index = attrdef["defindex"]
if attrdef:
index = attrdef["defindex"]

self._attributes.setdefault(index, {})

Expand All @@ -666,7 +667,10 @@ def __init__(self, item, schema=None):
index = attr["defindex"]

if schema and index not in self._attributes:
self._attributes[index] = schema._attribute_definition(index)
attrdef = schema._attribute_definition(index)

if attrdef:
self._attributes[index] = attrdef

self._attributes.setdefault(index, {})
self._attributes[index].update(attr)
Expand Down

0 comments on commit 2d5ade2

Please sign in to comment.