From 085df7e8af9dc341fef52fab4b3000edea968d41 Mon Sep 17 00:00:00 2001 From: Strahinja Val Markovic Date: Mon, 8 Apr 2013 11:14:06 -0700 Subject: [PATCH] Fix traceback print on None for |location| This happens when the user invokes a GoTo* command on a file with no compilation flags. --- python/completers/cpp/clang_completer.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python/completers/cpp/clang_completer.py b/python/completers/cpp/clang_completer.py index 78a5589c..ef830a26 100644 --- a/python/completers/cpp/clang_completer.py +++ b/python/completers/cpp/clang_completer.py @@ -169,7 +169,7 @@ class ClangCompleter( Completer ): def _GoToDefinition( self ): location = self._LocationForGoTo( 'GetDefinitionLocation' ) - if not location.IsValid(): + if not location or not location.IsValid(): vimsupport.PostVimMessage( 'Can\'t jump to definition.' ) return @@ -180,7 +180,7 @@ class ClangCompleter( Completer ): def _GoToDeclaration( self ): location = self._LocationForGoTo( 'GetDeclarationLocation' ) - if not location.IsValid(): + if not location or not location.IsValid(): vimsupport.PostVimMessage( 'Can\'t jump to declaration.' ) return @@ -191,9 +191,9 @@ class ClangCompleter( Completer ): def _GoToDefinitionElseDeclaration( self ): location = self._LocationForGoTo( 'GetDefinitionLocation' ) - if not location.IsValid(): + if not location or not location.IsValid(): location = self._LocationForGoTo( 'GetDeclarationLocation' ) - if not location.IsValid(): + if not location or not location.IsValid(): vimsupport.PostVimMessage( 'Can\'t jump to definition or declaration.' ) return