Browse Source

fix uncaught error

Michael Wang 3 years ago
parent
commit
deae454d10
2 changed files with 2 additions and 2 deletions
  1. 1 1
      src/utils/monitors.js
  2. 1 1
      src/utils/util.js

+ 1 - 1
src/utils/monitors.js

@@ -87,7 +87,7 @@ window.addEventListener("unhandledrejection", function (event) {
       "_trackEvent",
       "全局Promise未处理错误",
       window.location.pathname.replace(/=\w*/g, "=").replace(/\d+/g, "{id}"),
-      event.reason.message.replace(/=\w*/g, "=").replace(/\d+/g, "{id}"),
+      event.reason?.message?.replace(/=\w*/g, "=").replace(/\d+/g, "{id}"),
     ]);
   }
 });

+ 1 - 1
src/utils/util.js

@@ -232,6 +232,6 @@ export async function getScreenShot({ cause = "ss-none" }) {
       cause,
     });
   } finally {
-    video.play();
+    video && video.play();
   }
 }