consoleview: fix handling of undefined URL strings
PATCH 1/1 consoleview: fix handling of undefined URL strings
Some errors were observed on the console view when the URL string is undefined. Reason for undefined URLs is unexplained so far, but we should at least try to not generate any JS exception.
Signed-off-by Mathieu Dubois-Briand <[email protected]>
--- yocto_console_view/src/views/ConsoleView/ConsoleView.tsx | 4 ++++ 1 file changed, 4 insertions(+)
yocto_console_view/src/views/ConsoleView/ConsoleView.tsx +4 -0
@@ -156,6 +156,10 @@ const gitHostAliases = new Map([ function getHttpURL(url) { + if (url === undefined) { + return url; + } + let u = new URL(url.replace(RegExp("^[a-z]*://"), "https://")); u.username = ""; if (gitHostAliases.has(u.host)) {
---
base-commit: fdc34623463b1c708220021649ba4b8b53db3dbf
change-id: 20251108-mathieu-fix-url-replace-7f62a4fa56b0
Best regards,
Signature · 1 line
Mathieu Dubois-Briand <[email protected]>