Skip to content

Commit de6ae74

Browse files
mattnprabirshrestha
authored andcommitted
Check result is null (#222)
Completion possibly return null
1 parent f67ef09 commit de6ae74

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

autoload/lsp/omni.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ function! s:get_completion_result(data) abort
144144
let l:incomplete = l:result['isIncomplete']
145145
endif
146146

147-
let l:matches = map(l:items, {_, item -> lsp#omni#get_vim_completion_item(item) })
147+
let l:matches = type(l:items) == type([]) ? map(l:items, {_, item -> lsp#omni#get_vim_completion_item(item) }) : []
148148

149149
return {'matches': l:matches, 'incomplete': l:incomplete}
150150
endfunction

0 commit comments

Comments
 (0)