Fix: disable crash in settings by improving typing

This commit is contained in:
Pieter Vander Vennet 2025-07-06 00:12:07 +02:00
parent f1dc2c30c0
commit edbfc5f86b
4 changed files with 19 additions and 5 deletions

View file

@ -1630,7 +1630,12 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
;[_, functionName, path, line, column] = matchWithFuncName
} else {
const regexNoFuncName: RegExp = new RegExp("at ([a-zA-Z0-9-/.]+):([0-9]+):([0-9]+)")
;[_, path, line, column] = stackItem.match(regexNoFuncName)
try {
[_, path, line, column] = stackItem.match(regexNoFuncName)
} catch (e) {
console.error("Could not match a stack item:", stackItem)
return undefined
}
}
const markdownLocation = path.substring(path.indexOf("MapComplete/src") + 11) + "#L" + line