Merge pull request #35050 from Nandhinidevi123/workstation_filter

add if condition for workstation filter
diff --git a/erpnext/manufacturing/doctype/bom/bom.js b/erpnext/manufacturing/doctype/bom/bom.js
index 7cdcef9..ad9aafe 100644
--- a/erpnext/manufacturing/doctype/bom/bom.js
+++ b/erpnext/manufacturing/doctype/bom/bom.js
@@ -652,7 +652,7 @@
 
 frappe.ui.form.on("BOM Operation", "workstation", function(frm, cdt, cdn) {
 	var d = locals[cdt][cdn];
-
+	if(!d.workstation) return;
 	frappe.call({
 		"method": "frappe.client.get",
 		args: {
diff --git a/erpnext/manufacturing/doctype/routing/routing.js b/erpnext/manufacturing/doctype/routing/routing.js
index b480c70..784e83a 100644
--- a/erpnext/manufacturing/doctype/routing/routing.js
+++ b/erpnext/manufacturing/doctype/routing/routing.js
@@ -50,7 +50,7 @@
 
 	workstation: function(frm, cdt, cdn) {
 		const d = locals[cdt][cdn];
-
+		if(!d.workstation) return;
 		frappe.call({
 			"method": "frappe.client.get",
 			args: {