Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed an error raised when object is undefined in OI contest mode #110

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/pages/oj/views/problem/Problem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,11 @@
let data2 = JSON.parse(JSON.stringify(data))
data2[1].selected = true
this.largePie.series[1].data = data2

// OI模式封榜时statistic_info为空,会导致代码无法正确执行,导致错误(如:代码模板不加载)
if (problemData.statistic_info === undefined) {
return
}

// 根据结果设置legend,没有提交过的legend不显示
let legend = Object.keys(problemData.statistic_info).map(ele => JUDGE_STATUS[ele].short)
Expand Down