fix: Handle exception

This commit is contained in:
Suraj Shetty 2021-05-05 17:26:32 +05:30
parent 22dfb6a3d8
commit d0a8f9d01f

View file

@ -158,8 +158,8 @@ def evaluate_dynamic_routes(rules, path):
route_map = Map(rules)
endpoint = None
if frappe.local.request:
urls = route_map.bind_to_environ(frappe.local.request.environ or dict())
if frappe.local.request and frappe.local.request.environ:
urls = route_map.bind_to_environ(frappe.local.request.environ)
try:
endpoint, args = urls.match("/" + path)
path = endpoint