[minor] catch illegal reference, via error report
diff --git a/erpnext/utilities/transaction_base.py b/erpnext/utilities/transaction_base.py
index 278ec3b..d088f59 100644
--- a/erpnext/utilities/transaction_base.py
+++ b/erpnext/utilities/transaction_base.py
@@ -89,6 +89,9 @@
 				prevdoc_values = frappe.db.get_value(reference_doctype, reference_name,
 					[d[0] for d in fields], as_dict=1)
 
+				if not prevdoc_values:
+					frappe.throw(_("Invalid reference {0} {1}").format(reference_doctype, reference_name))
+
 				for field, condition in fields:
 					if prevdoc_values[field] is not None:
 						self.validate_value(field, condition, prevdoc_values[field], doc)