Skip to content

Commit c1beddb

Browse files
author
lucifer
committed
fix: 获取题目详情逻辑修复
1 parent cbbff2f commit c1beddb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

‎src/contentScript.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,12 @@ function insertButton() {
207207
).innerText;
208208

209209
const desc = document.querySelector("#question-detail-main-tabs")
210-
.children[1].children[0].children[1].innerText;
210+
?.children[1]?.children[0]?.children[1]?.innerText;
211+
if (!desc) {
212+
return message.warn({
213+
content: "获取题目描述失败,请先切换到题目描述标签",
214+
});
215+
}
211216
const hide = message.loading("正在存储题目信息,请稍后~", 0);
212217
writeSolutionButton.setAttribute("disabled", true);
213218
// Dismiss manually and asynchronously

0 commit comments

Comments
 (0)