Return an empty location instead of segfaulting
This commit is contained in:
parent
1676a3b2a4
commit
a00535f078
@ -272,6 +272,9 @@ Location ClangCompleter::GetDeclarationLocation(
|
||||
filename,
|
||||
unsaved_files,
|
||||
flags );
|
||||
if (!unit) {
|
||||
return Location();
|
||||
}
|
||||
return unit->GetDeclarationLocation( line, column, unsaved_files );
|
||||
}
|
||||
|
||||
@ -286,6 +289,9 @@ Location ClangCompleter::GetDefinitionLocation(
|
||||
filename,
|
||||
unsaved_files,
|
||||
flags );
|
||||
if (!unit) {
|
||||
return Location();
|
||||
}
|
||||
return unit->GetDefinitionLocation( line, column, unsaved_files );
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user