mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-01 20:52:27 +08:00
client: Fix crash for some unhandled rejections
This commit is contained in:
parent
b10e2d9ec4
commit
f8df3a6933
@ -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 += [
|
||||
|
Loading…
x
Reference in New Issue
Block a user