From 0bdb09e299a082c316457b5216969a2723f021aa Mon Sep 17 00:00:00 2001 From: Ryan Huber Date: Thu, 12 Feb 2015 08:32:38 -0800 Subject: only update nicklist if channel buffer exists --- wee_slack.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'wee_slack.py') diff --git a/wee_slack.py b/wee_slack.py index fc3a633..a0d346d 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -395,17 +395,18 @@ class Channel(SlackThing): self.channel_buffer = None def update_nicklist(self): - w.buffer_set(self.channel_buffer, "nicklist", "1") - w.nicklist_remove_all(self.channel_buffer) - try: - for user in self.members: - user = self.server.users.find(user) - if user.presence == 'away': - w.nicklist_add_nick(self.channel_buffer, "", user.name, user.color_name, " ", "", 1) - else: - w.nicklist_add_nick(self.channel_buffer, "", user.name, user.color_name, "+", "", 1) - except: - print "DEBUG: {} {}".format(self.identifier,self.name) + if self.channel_buffer: + w.buffer_set(self.channel_buffer, "nicklist", "1") + w.nicklist_remove_all(self.channel_buffer) + try: + for user in self.members: + user = self.server.users.find(user) + if user.presence == 'away': + w.nicklist_add_nick(self.channel_buffer, "", user.name, user.color_name, " ", "", 1) + else: + w.nicklist_add_nick(self.channel_buffer, "", user.name, user.color_name, "+", "", 1) + except: + print "DEBUG: {} {}".format(self.identifier,self.name) def fullname(self): return "{}.{}".format(self.server.domain, self.name) -- cgit