Fix issue with old item in market service causing error due to being non-existent.

This commit is contained in:
blitzmann
2015-12-09 20:54:29 -05:00
parent ae55a2c1d2
commit 0dd98330aa
2 changed files with 6 additions and 3 deletions

View File

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

View File

@@ -504,8 +504,10 @@ class Market():
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