Commit 8c2973e2 authored by Romain Courteaud's avatar Romain Courteaud

erp5_web_renderjs_ui: service worker document may not exist

parent dddbca2b
......@@ -2,9 +2,14 @@ import re
service_worker_reference = context.getLayoutProperty("configuration_service_worker_url", default="gadget_erp5_serviceworker.js")
text_content = context.web_page_module.searchFolder(
service_worker = context.web_page_module.getResultValue(
portal_type='Web Script',
reference=service_worker_reference)[0].getTextContent()
reference=service_worker_reference)
if service_worker is None:
text_content = ''
else:
text_content = service_worker.getTextContent()
filename_pattern = re.compile("'(?P<filename>[a-zA-Z0-9-_\.\?=]*)'")
filename_list = []
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment