Skip to content
This repository was archived by the owner on Feb 14, 2022. It is now read-only.

Commit 3c39ce4

Browse files
committed
Fixed 'undefined undefined' bug if problem is not present in solved.ac server
1 parent 5a5a1b7 commit 3c39ce4

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

content.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ function kudekiLevelLabel(level) {
139139
if (document.getElementById("problem-body") || document.getElementById("chart_div")) {
140140
const problemId = document.querySelector("ul.problem-menu li a").innerText.replace(/[^0-9.]/g, "");
141141
getJson("https://api.solved.ac/problem_level.php?id=" + problemId, function(levelData) {
142+
if (levelData.level == null) return;
142143
getJson("https://api.solved.ac/question_level_votes.php?id=" + problemId, function(difficultyVotes) {
143144
const nick = document.querySelector("ul.loginbar li:first-child a").innerText.trim();
144145
var votedFlag = false;

0 commit comments

Comments
 (0)