Fix traceback sending bot messages to invite-only stream.

(imported from commit b9af67e87d8b7d52bddb8fa576af8fe9326ba13c)
This commit is contained in:
Tim Abbott
2014-05-02 15:30:16 -07:00
parent d2d9d9cb01
commit f7535a0a1b

View File

@@ -716,7 +716,8 @@ def check_message(sender, client, message_type_name, message_to,
elif subscribed_to_stream(sender, stream):
# Or it is private, but your are subscribed
pass
elif is_super_user(sender) or is_super_user(forwarder_user_profile):
elif is_super_user(sender) or (forwarder_user_profile is not None and
is_super_user(forwarder_user_profile)):
# Or this request is being done on behalf of a super user
pass
elif sender.is_bot and subscribed_to_stream(sender.bot_owner, stream):