From 4b17b77a99e22d957fab349df55099207a19cbce Mon Sep 17 00:00:00 2001 From: Hussain Nagaria Date: Mon, 2 Feb 2026 17:39:53 +0530 Subject: [PATCH] fix: get_app_path throws if app is no longer installed --- ..._standard_field_for_auto_generated_icons.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/frappe/patches/v16_0/unset_standard_field_for_auto_generated_icons.py b/frappe/patches/v16_0/unset_standard_field_for_auto_generated_icons.py index e12f34cf7c..d18ec73f09 100644 --- a/frappe/patches/v16_0/unset_standard_field_for_auto_generated_icons.py +++ b/frappe/patches/v16_0/unset_standard_field_for_auto_generated_icons.py @@ -5,14 +5,14 @@ from frappe.model.sync import check_if_record_exists def execute(): for icon in frappe.get_all("Desktop Icon"): icon_doc = frappe.get_doc("Desktop Icon", icon.name) - if (icon_doc.standard and icon_doc.app) and not check_if_record_exists( - "app", - frappe.get_app_path(icon_doc.app), - "Desktop Icon", - icon_doc.name, - ): - try: + try: + if (icon_doc.standard and icon_doc.app) and not check_if_record_exists( + "app", + frappe.get_app_path(icon_doc.app), + "Desktop Icon", + icon_doc.name, + ): icon_doc.standard = 0 icon_doc.save() - except Exception as e: - print("Error in unsetting standard field", e) + except Exception as e: + print("Error in unsetting standard field", e)