From f4cd21e4e07ab80a0fc7a235400509e87e3e64e7 Mon Sep 17 00:00:00 2001 From: fedeb Date: Sat, 7 Nov 2020 21:15:26 +0100 Subject: [PATCH] Another check if a given topic has just the :list and rosetta/ --- lib/routing.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/routing.py b/lib/routing.py index d8ac53c..6be5269 100644 --- a/lib/routing.py +++ b/lib/routing.py @@ -119,6 +119,9 @@ class Router(object): #Here we remove the special cases if ":list" in topic_list: topic_list.remove(":list") if "rosetta/" in topic_list: topic_list.remove("rosetta/") + #Here we still check that topic_list in not empty + if not topic_list: + return prefix random_topic = random.choice(topic_list) return prefix + random_topic