Skip to content

Commit

Permalink
Merge pull request #327 from decert-me/hotfix-console
Browse files Browse the repository at this point in the history
hotfix: 挑战仅有一道编程题时,不作答编程题直接提交报错
  • Loading branch information
0xdwong authored Jan 3, 2024
2 parents 2252edd + 2231b56 commit 82742c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/CustomChallenge/CustomCode.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ function CustomCode(props, ref) {

const obj = cacheQuest.code_snippets[selectIndex];
let cache = JSON.parse(localStorage.getItem("decert.cache"));
if (!params && cache[token_id][index] && JSON.stringify(obj.code) === JSON.stringify(cache[token_id][index].code)) {
if (!params && cache[token_id] && cache[token_id][index] && JSON.stringify(obj.code) === JSON.stringify(cache[token_id][index].code)) {
// 切换页面时判断是否需要向后端发起判题
return
}
Expand Down

0 comments on commit 82742c0

Please sign in to comment.