client: Fix crash for some unhandled rejections

This commit is contained in:
Elian Doran 2024-10-31 17:48:33 +02:00
parent b10e2d9ec4
commit f8df3a6933
No known key found for this signature in database

View File

@ -50,11 +50,11 @@ function setupGlobs() {
};
window.addEventListener("unhandledrejection", (e) => {
const string = e.reason.message.toLowerCase();
const string = e?.reason?.message?.toLowerCase();
let message = "Uncaught error: ";
if (string.includes("script error")) {
if (string?.includes("script error")) {
message += 'No details available';
} else {
message += [