home · contact · privacy
Browser: Fix by_1st view crashing if nothing to sort.
authorChristian Heller <c.heller@plomlompom.de>
Sat, 26 Oct 2024 13:34:39 +0000 (15:34 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Sat, 26 Oct 2024 13:34:39 +0000 (15:34 +0200)
browser.py

index 939dc1a53e5675afde81f76cf285aa9a00a5ef8d..31f146e74649d7dfbd5df26f6a27aa5e746bfa35 100755 (executable)
@@ -840,6 +840,9 @@ class Gallery:
                     vals = self.items_attrs[sorter.name]['incl']
                     if len(vals) > 1:
                         sort_attrs += [(sorter.name, vals)]
+                if not sort_attrs:
+                    s_name = self._sort_order[0].name
+                    sort_attrs += [(s_name, self.items_attrs[s_name]['incl'])]
                 self._per_row = len(sort_attrs[-1][1])
                 build_rows_by_attrs(sort_attrs, entries_filtered, [])
             else: