From f015d518a390803ea08eb0f206bddc645384a402 Mon Sep 17 00:00:00 2001 From: micbou Date: Sun, 27 Dec 2015 18:46:05 +0100 Subject: [PATCH] Fix traceback when v:completed_item is empty Check if the Vim variable v:completed_item is not empty before accessing one of its keys. Prevent a traceback when the ycmd server crashed. --- python/ycm/youcompleteme.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python/ycm/youcompleteme.py b/python/ycm/youcompleteme.py index 6e86646f..9a1a3b4b 100644 --- a/python/ycm/youcompleteme.py +++ b/python/ycm/youcompleteme.py @@ -390,6 +390,9 @@ class YouCompleteMe( object ): def _HasCompletionsThatCouldBeCompletedWithMoreText_NewerVim( self, completions ): completed_item = vimsupport.GetVariableValue( 'v:completed_item' ) + if not completed_item: + return False + completed_word = completed_item[ 'word' ] if not completed_word: return False