diff --git a/frappe/__init__.py b/frappe/__init__.py index ad07b11caf..c03b87be1c 100644 --- a/frappe/__init__.py +++ b/frappe/__init__.py @@ -1115,7 +1115,7 @@ def can_cache_doc(args) -> str | None: return doctype = args[0] - name = doctype if len(args) == 1 else args[1] + name = doctype if len(args) == 1 or args[1] is None else args[1] # Only cache if both doctype and name are strings if isinstance(doctype, str) and isinstance(name, str):