aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorGravatar jesopo2019-09-17 14:14:30 +0100
committerGravatar jesopo2019-09-17 14:14:30 +0100
commit92840f67ee28d30b9ebfe2154a93fc192e796d30 (patch)
treec5868982190af8f7d2a16205e86c9640fe1ff09b /modules
parentResponse.__init__() needs `encoding` now (diff)
signature
don't die when channel.topic_setter is null
Diffstat (limited to 'modules')
-rw-r--r--modules/stats.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/stats.py b/modules/stats.py
index acf85ac1..6d1b2b3d 100644
--- a/modules/stats.py
+++ b/modules/stats.py
@@ -105,12 +105,15 @@ class Module(ModuleManager.BaseModule):
return servers
def _channel_stats(self, channel):
+ setter = None
+ if not channel.topic_setter == None:
+ setter = channel.topic_setter.nickname
return {
"users": sorted([user.nickname for user in channel.users],
key=lambda nickname: nickname.lower()),
"topic": channel.topic,
"topic-set-at": channel.topic_time,
- "topic-set-by": channel.topic_setter.nickname,
+ "topic-set-by": setter,
"modes": channel.mode_str()
}
@utils.hook("api.get.channels")