Fix issue with old item in market service causing error due to being non-existent.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user