b:airline_head sometimes undefined

Make sure, b:airline_head variable is set, also it is initially set in
this function earlier. But see #1171 for an error.

Therefore, before checking if the variable is empty, make sure it
exists.

fixes #1171
This commit is contained in:
Christian Brabandt 2016-05-22 21:29:00 +02:00
parent 70c16f4c46
commit 985f3d3eca
1 changed files with 1 additions and 0 deletions

View File

@ -141,6 +141,7 @@ function! airline#extensions#branch#head()
endif
endif
else
let b:airline_head = get(b:, 'airline_head', '')
for vcs in l:vcs_priority
if has_key(l:heads, vcs)
if !empty(b:airline_head)