Avoid spurious exceptions when adding None custom metadata

This commit is contained in:
Charles Haley 2010-09-11 09:23:03 +01:00
parent 4f01b09ded
commit afe5546a15

View File

@ -161,6 +161,7 @@ class Metadata(object):
'Custom field name %s must begin with \'#\''%repr(field)) 'Custom field name %s must begin with \'#\''%repr(field))
if metadata is None: if metadata is None:
traceback.print_stack() traceback.print_stack()
return
metadata = copy.deepcopy(metadata) metadata = copy.deepcopy(metadata)
if '#value#' not in metadata: if '#value#' not in metadata:
if metadata['datatype'] == 'text' and metadata['is_multiple']: if metadata['datatype'] == 'text' and metadata['is_multiple']: