async: Check existence of buffer before accessing it

fixes #1936
This commit is contained in:
Christian Brabandt 2019-06-14 09:40:30 +02:00
parent 63a75aca2a
commit 71c80aaf54
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
1 changed files with 4 additions and 2 deletions

View File

@ -69,8 +69,10 @@ function! s:set_clean_variables(file, vcs, val)
if has_key(var, a:vcs) && has_key(var[a:vcs], 'dirty') &&
\ type(getbufvar(fnameescape(a:file), 'buffer_vcs_config')) == type({})
let var[a:vcs].dirty=a:val
call setbufvar(fnameescape(a:file), 'buffer_vcs_config', var)
unlet! b:airline_head
if bufexists(a:file)
call setbufvar(fnameescape(a:file), 'buffer_vcs_config', var)
unlet! b:airline_head
endif
endif
endfunction