Skip to content

Commit

Permalink
fix: do not decode empty strings, closes #105
Browse files Browse the repository at this point in the history
  • Loading branch information
kkoomen committed Oct 12, 2020
1 parent 676c8dc commit b26026b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion autoload/doge/helpers.vim
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,12 @@ function! doge#helpers#parser(args) abort
let l:result = system('node ' . l:script_path . ' ' . join(l:args, ' '))

try
return json_decode(l:result)
if !empty(l:result)
return json_decode(l:result)
endif
catch /.*/
echo '[DoGe] ' . b:doge_parser . ' parser failed'
echo '[Doge] Exception: ' . v:exception
echo l:result
finally
call setpos('.', l:cursor_pos)
Expand Down

0 comments on commit b26026b

Please sign in to comment.