AttributeError in validator.py:VMessageRecipient

AttributeError: 'NoneType' object has no attribute '_id'(b412c68f4d2e201e4f4c4a459776dafe)
Introduced after blacklist push.
This commit is contained in:
Keith Mitchell
2011-07-12 14:41:33 -07:00
committed by Neil Williams
parent c1c5fbd9c4
commit b8023e73ec

View File

@@ -911,7 +911,7 @@ class VMessageRecipient(VExistingUname):
self.set_error(errors.SUBREDDIT_NOEXIST)
else:
account = VExistingUname.run(self, name)
if account._id in c.user.enemies:
if account and account._id in c.user.enemies:
self.set_error(errors.USER_BLOCKED)
else:
return account