Skip to content

Commit 86e9e16

Browse files
committed
fix: when encounter syntax error, .expected_code_answer is null
1 parent d6a651c commit 86e9e16

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2019-10-11 Wang Kai <[email protected]>
2+
3+
* leetcode.el (leetcode-try): When encounter syntax error, .expected_code_answer is null. Handle this situation depend on status_code.
4+
15
2019-10-10 Wang Kai <[email protected]>
26

37
* leetcode.el: submissions detail API modification

leetcode.el

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
;; Keywords: extensions, tools
77
;; URL: https://github.com/kaiwk/leetcode.el
88
;; Package-Requires: ((emacs "26") (dash "2.16.0") (graphql "0.1.1") (spinner "1.7.3") (aio "1.0"))
9-
;; Version: 0.1.8
9+
;; Version: 0.1.9
1010

1111
;; This program is free software; you can redistribute it and/or modify
1212
;; it under the terms of the GNU General Public License as published by
@@ -584,11 +584,14 @@ see: https://github.com/skeeto/emacs-aio/issues/3."
584584
(let-alist actual_res
585585
(with-current-buffer res-buf
586586
(goto-char (point-max))
587-
(insert (concat "Expected:\n" (aref .expected_code_answer 0) "\n\n"))
588-
(insert "Output:\n")
589587
(cond
590588
((eq .status_code 10)
591-
(insert (aref .code_answer 0)))
589+
(insert "Output:\n")
590+
(insert (aref .code_answer 0))
591+
(insert "\n\n")
592+
(insert "Expected:\n")
593+
(insert (aref .expected_code_answer 0))
594+
(insert "\n\n"))
592595
((eq .status_code 14)
593596
(insert .status_msg))
594597
((eq .status_code 15)

0 commit comments

Comments
 (0)