From b5b4a5e0fd876d19ea2d17d9f5349b2e4980d362 Mon Sep 17 00:00:00 2001 From: AD Date: Tue, 29 Jan 2019 14:35:08 +0100 Subject: [PATCH] fix: catch empty top_list --- tagmaps/classes/cluster.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tagmaps/classes/cluster.py b/tagmaps/classes/cluster.py index 6a00b30..4a88899 100644 --- a/tagmaps/classes/cluster.py +++ b/tagmaps/classes/cluster.py @@ -57,7 +57,10 @@ def __init__(self, bounds: AnalysisBounds, self.cleaned_post_dict = cleaned_post_dict self.cleaned_post_list = cleaned_post_list self.top_list = top_list - self.top_item = top_list[0] + if self.top_list: + self.top_item = top_list[0] + else: + self.top_item = None self.total_distinct_locations = total_distinct_locations self.autoselect_clusters = False self.sel_colors = None