Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix traceback print on None for |location|

This happens when the user invokes a GoTo* command on a file with no compilation
flags.
  • Loading branch information...
commit 085df7e8af9dc341fef52fab4b3000edea968d41 1 parent 1268a25
@Valloric authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 python/completers/cpp/clang_completer.py
View
8 python/completers/cpp/clang_completer.py
@@ -169,7 +169,7 @@ def _LocationForGoTo( self, goto_function ):
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 @@ def _GoToDefinition( self ):
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 @@ def _GoToDeclaration( self ):
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
Please sign in to comment.
Something went wrong with that request. Please try again.