Return None if card could not be found in the database
This commit is contained in:
parent
49bf2a9d0c
commit
eeee15c738
1 changed files with 2 additions and 0 deletions
|
@ -56,6 +56,8 @@ class TextDB(Database):
|
||||||
else:
|
else:
|
||||||
# Prepare to read in the next record
|
# Prepare to read in the next record
|
||||||
inRecord = False
|
inRecord = False
|
||||||
|
if not card:
|
||||||
|
return None
|
||||||
return Card(card['name'], card['type'], card['attributes'], card['cost'], card['power'], card['toughness'], card['rarity'])
|
return Card(card['name'], card['type'], card['attributes'], card['cost'], card['power'], card['toughness'], card['rarity'])
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
Loading…
Reference in a new issue