summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw0rp <w0rp@users.noreply.github.com>2018-06-27 21:34:28 +0100
committerGitHub <noreply@github.com>2018-06-27 21:34:28 +0100
commitb047271051d8ef448bf4bac120234205310b232a (patch)
tree63c33cc35c67b01ea46c03ace2c8e5b2f9f1369d
parent66820ed452839a9e09eb18bbaad538d3a25d33f8 (diff)
parent1ca233484604eea2a1fc2027c6dfc8d7a90f5f89 (diff)
downloadale-b047271051d8ef448bf4bac120234205310b232a.zip
Merge pull request #1682 from fennerm/fix_prospector_e474
Fix prospector empty string error
-rw-r--r--ale_linters/python/prospector.vim4
-rw-r--r--test/handler/test_prospector_handler.vader5
2 files changed, 9 insertions, 0 deletions
diff --git a/ale_linters/python/prospector.vim b/ale_linters/python/prospector.vim
index eadfee47..fff37147 100644
--- a/ale_linters/python/prospector.vim
+++ b/ale_linters/python/prospector.vim
@@ -30,6 +30,10 @@ endfunction
function! ale_linters#python#prospector#Handle(buffer, lines) abort
let l:output = []
+ if empty(a:lines)
+ return []
+ endif
+
let l:prospector_error = json_decode(join(a:lines, ''))
for l:error in l:prospector_error.messages
diff --git a/test/handler/test_prospector_handler.vader b/test/handler/test_prospector_handler.vader
index 7962f6cd..935c37da 100644
--- a/test/handler/test_prospector_handler.vader
+++ b/test/handler/test_prospector_handler.vader
@@ -156,3 +156,8 @@ Execute(Ignoring trailing whitespace messages should work):
\ ' ]',
\ '}',
\ ])
+
+Execute(The prospector handler should handle empty output):
+ AssertEqual
+ \ [],
+ \ ale_linters#python#prospector#Handle(bufnr(''), [])