From 019c6aa001616c09571c3107ef7c18b03f6536b7 Mon Sep 17 00:00:00 2001 From: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com> Date: Tue, 10 Mar 2026 12:00:40 +0530 Subject: [PATCH] fix: handle undefined field values in set_value_field function (#37886) --- frappe/public/js/frappe/list/bulk_operations.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frappe/public/js/frappe/list/bulk_operations.js b/frappe/public/js/frappe/list/bulk_operations.js index 0b794a03c3..3d0c2924ae 100644 --- a/frappe/public/js/frappe/list/bulk_operations.js +++ b/frappe/public/js/frappe/list/bulk_operations.js @@ -391,12 +391,14 @@ export default class BulkOperations { show_help_text(); function set_value_field(dialogObj) { - const new_df = Object.assign({}, field_mappings[dialogObj.get_value("field")]); + const field_value = dialogObj.get_value("field"); + if (!field_value || !field_mappings[field_value]) return; + const new_df = Object.assign({}, field_mappings[field_value]); /* if the field label has status in it and if it has select fieldtype with no default value then set a default value from the available option. */ if ( - new_df.label.match(status_regex) && + new_df.label?.match(status_regex) && new_df.fieldtype === "Select" && !new_df.default ) {