Skip to content

Commit

Permalink
Fix issue with old item in market service causing error due to being …
Browse files Browse the repository at this point in the history
…non-existent.
  • Loading branch information
blitzmann committed Dec 10, 2015
1 parent ae55a2c commit 0dd9833
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion eos/db/gamedata/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ def getItem(lookfor, eager=None):
else:
# Item names are unique, so we can use first() instead of one()
item = gamedata_session.query(Item).options(*processEager(eager)).filter(Item.name == lookfor).first()
itemNameMap[lookfor] = item.ID
if item:
itemNameMap[lookfor] = item.ID
else:
raise TypeError("Need integer or string as argument")
return item
Expand Down
6 changes: 4 additions & 2 deletions service/market.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,8 +504,10 @@ def getVariationsByItems(self, items, alreadyparent=False):
parents.add(parent)
# Check for overrides and add them if any
if parent.name in self.ITEMS_FORCEDMETAGROUP_R:
for itmn in self.ITEMS_FORCEDMETAGROUP_R[parent.name]:
variations.add(self.getItem(itmn))
for item in self.ITEMS_FORCEDMETAGROUP_R[parent.name]:
i = self.getItem(item)
if i:
variations.add(i)
# Add all parents to variations set
variations.update(parents)
# Add all variations of parents to the set
Expand Down

0 comments on commit 0dd9833

Please sign in to comment.