diff --git a/patches/november_2012/custom_field_insert_after.py b/patches/november_2012/custom_field_insert_after.py index 403f88d83c..6824e7a5e1 100644 --- a/patches/november_2012/custom_field_insert_after.py +++ b/patches/november_2012/custom_field_insert_after.py @@ -6,6 +6,7 @@ def execute(): for name, insert_after in webnotes.conn.sql("""select name, insert_after from `tabCustom Field`"""): - new_insert_after = regex.sub("", insert_after) - webnotes.conn.set_value("Custom Field", name, "insert_after", new_insert_after) + if insert_after: + new_insert_after = regex.sub("", insert_after) + webnotes.conn.set_value("Custom Field", name, "insert_after", new_insert_after) \ No newline at end of file