Fixed possible crash when computing the AST path.

This commit is contained in:
Roberto Raggi
2010-07-05 17:07:20 +02:00
parent 1519efbeaf
commit a1d3c63874

View File

@@ -44,7 +44,12 @@ QList<AST *> ASTPath::operator()(int line, int column)
_nodes.clear();
_line = line + 1;
_column = column + 1;
accept(_doc->translationUnit()->ast());
if (_doc) {
if (TranslationUnit *unit = _doc->translationUnit())
accept(unit->ast());
}
return _nodes;
}