From 2db882e9b8252b120da33216012e481652d7e93e Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Wed, 1 May 2019 07:45:06 +0200 Subject: [PATCH] async: check dictionary keys before trying to access them --- autoload/airline/async.vim | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/autoload/airline/async.vim b/autoload/airline/async.vim index be82d6a..5ce0233 100644 --- a/autoload/airline/async.vim +++ b/autoload/airline/async.vim @@ -66,9 +66,11 @@ endfunction function! s:set_clean_variables(file, vcs) let var=getbufvar(fnameescape(a:file), 'buffer_vcs_config', {}) - let var[a:vcs].dirty=1 - call setbufvar(fnameescape(a:file), 'buffer_vcs_config', var) - unlet! b:airline_head + if has_key(var, a:vcs) && has_key(var[a:vcs], 'dirty') + let var[a:vcs].dirty=1 + call setbufvar(fnameescape(a:file), 'buffer_vcs_config', var) + unlet! b:airline_head + endif endfunction function! s:on_exit_clean(...) dict abort