Fix 3373 - do not crash on HandleUserData with invalid json (#3807)

Co-authored-by: Horacio Sanson <horacio@allm.inc>
This commit is contained in:
Horacio Sanson 2021-07-13 08:37:21 +09:00 committed by GitHub
parent c8f669249a
commit d098124e59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1002,7 +1002,7 @@ endfunction
function! ale#completion#HandleUserData(completed_item) abort
let l:user_data_json = get(a:completed_item, 'user_data', '')
let l:user_data = !empty(l:user_data_json)
\ ? json_decode(l:user_data_json)
\ ? ale#util#FuzzyJSONDecode(l:user_data_json, v:null)
\ : v:null
if type(l:user_data) isnot v:t_dict