diff --git a/resources/web/code-web.js b/resources/web/code-web.js index 6773985431f..c4bac6317de 100644 --- a/resources/web/code-web.js +++ b/resources/web/code-web.js @@ -424,7 +424,7 @@ async function handleRoot(req, res) { ); const openFileUrl = args['open-file'] ? url.parse(args['open-file'], true) : undefined; let selection; - if (openFileUrl.hash) { + if (openFileUrl?.hash) { const rangeMatch = /L(?\d+)(?::(?\d+))?((?:-L(?\d+))(?::(?\d+))?)?/.exec(openFileUrl.hash); if (rangeMatch?.groups) { const { startLineNumber, startColumn, endLineNumber, endColumn } = rangeMatch.groups;