From 491091706f408049201edf76b74ae521b4463513 Mon Sep 17 00:00:00 2001 From: Bailey Ling Date: Sun, 6 Oct 2013 09:03:47 -0400 Subject: [PATCH] add guard for possible undefined window context (#276). --- autoload/airline.vim | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/autoload/airline.vim b/autoload/airline.vim index c4c7d77..664c78e 100644 --- a/autoload/airline.vim +++ b/autoload/airline.vim @@ -120,7 +120,12 @@ function! s:invoke_funcrefs(context, funcrefs) endfunction function! airline#statusline(winnr) - return '%{airline#check_mode('.a:winnr.')}'.s:contexts[a:winnr].line + if has_key(s:contexts, a:winnr) + return '%{airline#check_mode('.a:winnr.')}'.s:contexts[a:winnr].line + endif + + " in rare circumstances this happens...see #276 + return '' endfunction function! airline#check_mode(winnr)