Skip to content

Commit 6a8c166

Browse files
authored
🐛 GM_xmlhttpRequest msgConn 的 null 处理缺失 (#1433)
1 parent 68beedb commit 6a8c166

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • src/app/service/service_worker/gm_api

src/app/service/service_worker/gm_api/gm_api.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,10 @@ export default class GMApi {
857857
if (!sender.isType(GetSenderType.CONNECT)) {
858858
throw new Error("GM_xmlhttpRequest ERROR: sender is not MessageConnect");
859859
}
860-
const msgConn = sender.getConnect()!;
860+
const msgConn = sender.getConnect();
861+
if (!msgConn) {
862+
throw new Error("GM_xmlhttpRequest ERROR: msgConn is undefined");
863+
}
861864

862865
let isConnDisconnected = false;
863866
msgConn.onDisconnect(() => {

0 commit comments

Comments
 (0)