Skip to content

Commit 3bebfae

Browse files
committed
fix leetcode.com RunCode fix #77
1 parent 4d274b3 commit 3bebfae

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

resources/META-INF/plugin.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<idea-plugin>
22
<id>leetcode-editor</id>
33
<name>leetcode editor</name>
4-
<version>5.3</version>
4+
<version>5.4</version>
55
<vendor email="shuzijun0109@gmail.com" url="https://github.com/shuzijun/idea-leetcode-plugin">shuzijun</vendor>
66

77
<description><![CDATA[
@@ -113,10 +113,10 @@
113113

114114
<change-notes><![CDATA[
115115
<ul>
116-
<li>v5.3<br>
116+
<li>v5.4<br>
117117
1.修复leetcode.com Run Code 超时问题<br>
118118
</li>
119-
<li>v5.3<br>
119+
<li>v5.4<br>
120120
1.fix leetcode.com RunCode Wait result timeout<br>
121121
</li>
122122
<li>v5.2<br>

src/com/shuzijun/leetcode/plugin/manager/CodeManager.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,10 @@ public void run() {
462462
if (jsonObject.getBoolean("run_success")) {
463463
String input = returnObj.getString("test_case");
464464
String output = jsonObject.getJSONArray("code_answer").getString(0);
465-
String expected = returnObj.getJSONArray("expected_code_answer").getString(0);
466-
if(StringUtils.isBlank(expected)){
465+
String expected = "";
466+
if (returnObj.getJSONArray("expected_code_answer") != null && !returnObj.getJSONArray("expected_code_answer").isEmpty()) {
467+
expected = returnObj.getJSONArray("expected_code_answer").getString(0);
468+
} else if (jsonObject.getJSONArray("expected_code_answer") != null && !jsonObject.getJSONArray("expected_code_answer").isEmpty()) {
467469
expected = jsonObject.getJSONArray("expected_code_answer").getString(0);
468470
}
469471
MessageUtils.showInfoMsg("info", PropertiesUtils.getInfo("test.success", input, output, expected));

0 commit comments

Comments
 (0)