fix(DX): Throw error when unsupported input is sent (#37438)

This commit is contained in:
Ankush Menat 2026-02-24 12:31:09 +05:30 committed by GitHub
parent 7eed4a13c3
commit a16938f455
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -265,6 +265,10 @@ def run_doc_method(method, docs=None, dt=None, dn=None, arg=None, args=None):
if dt: # not called from a doctype (from a page)
if not dn:
dn = dt # single
if not isinstance(dn, str | int):
frappe.throw("'dn' must be a string or an integer")
doc = frappe.get_doc(dt, dn, check_permission=True)
else: