diff options
| author | Roberto Raggi <[email protected]> | 2010-07-05 17:07:20 +0200 |
|---|---|---|
| committer | Roberto Raggi <[email protected]> | 2010-07-05 17:09:05 +0200 |
| commit | a1d3c63874b4fbd557b46b344ea3a330d287d0c7 (patch) | |
| tree | 5a77b06725a6c134684cd5268bef931db7f8b0ee /src/libs/cplusplus/ASTPath.cpp | |
| parent | 1519efbeaf80de62cef244ae9a5109f58fc3a9b8 (diff) | |
Fixed possible crash when computing the AST path.
Diffstat (limited to 'src/libs/cplusplus/ASTPath.cpp')
| -rw-r--r-- | src/libs/cplusplus/ASTPath.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libs/cplusplus/ASTPath.cpp b/src/libs/cplusplus/ASTPath.cpp index d1879fa1e27..28f5437d8c2 100644 --- a/src/libs/cplusplus/ASTPath.cpp +++ b/src/libs/cplusplus/ASTPath.cpp @@ -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; } |
