Merge pull request #2539 from nabinhait/fix1

item validation in bom
diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py
index 199ade9..bab1b43 100644
--- a/erpnext/manufacturing/doctype/bom/bom.py
+++ b/erpnext/manufacturing/doctype/bom/bom.py
@@ -57,6 +57,9 @@
 			last_purchase_rate, is_manufactured_item
 			from `tabItem` where name=%s""", item_code, as_dict = 1)
 
+		if not item:
+			frappe.throw(_("Item: {0} does not exist in the system").format(item_code))
+
 		return item
 
 	def validate_rm_item(self, item):