Skip to content
Permalink
Browse files

Object check order

First check object for existence, then it's properties
  • Loading branch information
alexyr committed Jan 4, 2017
1 parent bb2549b commit f09aa31563c4066a407839f46d5464d43c8d7132
Showing with 2 additions and 2 deletions.
  1. +2 −2 user/items_defenition.py
@@ -43,7 +43,7 @@ def remove_item_by_name(self, name):
ind = i
break

if ind >= 0 and not items[ind].iscursed and items[ind]:
if ind >= 0 and items[ind] and not items[ind].iscursed:
del self.items[ind]

return True
@@ -87,4 +87,4 @@ def has_item(self, code_name):
return False

def add_item(self, buff, name, context={}):
self.items.append( (buff, name, context) )
self.items.append( (buff, name, context) )

0 comments on commit f09aa31

Please sign in to comment.
You can’t perform that action at this time.