diff --git a/scripts/ztplot.py b/scripts/ztplot.py index cf3b27b82748ec44974a8b37a4e854e07a89f30f..ca64b19c818aaeecc12e26d9899e5d19c40e0f97 100755 --- a/scripts/ztplot.py +++ b/scripts/ztplot.py @@ -88,11 +88,14 @@ class ZTPlot(kp.Module): """Update the lower limits for the Top-10 candidate selection""" n_candidates = 10 for category in ["overlays", "n_hits", "n_triggered_hits"]: - lower_limit = self.services["query"]( - "SELECT {cat} FROM {tab} ORDER BY {cat} DESC LIMIT {limit}". - format(cat=category, - tab=self.event_selection_table, - limit=n_candidates))[-1][0] + try: + lower_limit = self.services["query"]( + "SELECT {cat} FROM {tab} ORDER BY {cat} DESC LIMIT {limit}". + format(cat=category, + tab=self.event_selection_table, + limit=n_candidates))[-1][0] + except IndexError: + lower_limit = 0 self.lower_limits[category] = lower_limit self.cprint("Current limits for the Top-10: {}".format(