Commit 13954bc5 authored by Christian Stenger's avatar Christian Stenger

AutoTest: Avoid nullptr access

Change-Id: I6be5d02a14fc921f189d7817da8ebb6284973858
Reviewed-by: Nikolai Kosjar's avatarNikolai Kosjar <nikolai.kosjar@qt.io>
parent c9dac0fa
......@@ -152,6 +152,10 @@ bool TestAstVisitor::visit(CPlusPlus::CallAST *ast)
bool TestAstVisitor::visit(CPlusPlus::CompoundStatementAST *ast)
{
if (!ast || !ast->symbol) {
m_currentScope = 0;
return false;
}
m_currentScope = ast->symbol->asScope();
return true;
}
......
......@@ -76,7 +76,7 @@ public:
private:
QString m_className;
CPlusPlus::Scope *m_currentScope;
CPlusPlus::Scope *m_currentScope = 0;
CPlusPlus::Document::Ptr m_currentDoc;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment