Skip to content

Commit 522d6f9

Browse files
committed
Do not try to create empty nodes with a negative ID.
1 parent 022d0e2 commit 522d6f9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

roundup/cgi/form_parser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -563,11 +563,11 @@ def parse(self, create=0, num_re=re.compile('^\d+$')):
563563
# either have a non-empty content property or no property at all. In
564564
# the latter case, nothing will change.
565565
for (cn, id), props in all_props.items():
566-
if id and id.startswith('-') and not props:
566+
if id is not None and id.startswith('-') and not props:
567567
# new item (any class) with no content - ignore
568568
del all_props[(cn, id)]
569569
elif isinstance(self.db.classes[cn], hyperdb.FileClass):
570-
if id and id.startswith('-'):
570+
if id is not None and id.startswith('-'):
571571
if not props.get('content', ''):
572572
del all_props[(cn, id)]
573573
elif props.has_key('content') and not props['content']:

0 commit comments

Comments
 (0)