diff --git a/patches/february_2013/update_company_in_leave_application.py b/patches/february_2013/update_company_in_leave_application.py index eaf03b60839..be07cb8f355 100644 --- a/patches/february_2013/update_company_in_leave_application.py +++ b/patches/february_2013/update_company_in_leave_application.py @@ -7,5 +7,6 @@ def execute(): `tabLeave Application`.employee = `tabEmployee`.name""") company = webnotes.conn.get_default("company") - webnotes.conn.sql("""update `tabLeave Application` - set company = %s where ifnull(company,'')=''""", company) \ No newline at end of file + if company: + webnotes.conn.sql("""update `tabLeave Application` + set company = %s where ifnull(company,'')=''""", company) \ No newline at end of file