changeset 2803:a69460375016

fix DataBrowserWidget output if there is no data
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Fri, 07 Sep 2007 22:33:35 +0200
parents 6309a258f094
children 0e033c419e07
files MoinMoin/widget/browser.py
diffstat 1 files changed, 9 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/widget/browser.py	Fri Sep 07 01:08:03 2007 +0200
+++ b/MoinMoin/widget/browser.py	Fri Sep 07 22:33:35 2007 +0200
@@ -121,15 +121,16 @@
         # add data
         self.data.reset()
         row = self.data.next()
-        filters = [None] * len(row)
+        if row is not None:
+            filters = [None] * len(row)
 
-        if havefilters:
-            for idx in range(len(row)):
-                name = '%sfilter%d' % (self.data_id, idx)
-                if name in self.request.form:
-                    filters[idx] = self.request.form[name][0]
-                    if filters[idx] == self._all:
-                        filters[idx] = None
+            if havefilters:
+                for idx in range(len(row)):
+                    name = '%sfilter%d' % (self.data_id, idx)
+                    if name in self.request.form:
+                        filters[idx] = self.request.form[name][0]
+                        if filters[idx] == self._all:
+                            filters[idx] = None
 
         while row:
             hidden = False