forked from qt-creator/qt-creator
QMLDebugging: Fix crash
Check for null pointers when parsing AST to relocate breakpoint Change-Id: I484048d9e8a7aabdeffc4e18049c9b9b6f030366 Reviewed-by: Simjees Abraham <simjees.abraham@nokia.com> Reviewed-by: Kai Koehne <kai.koehne@nokia.com> Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
This commit is contained in:
@@ -154,6 +154,9 @@ public:
|
||||
|
||||
bool visit(UiScriptBinding *ast)
|
||||
{
|
||||
if (!ast->statement)
|
||||
return true;
|
||||
|
||||
quint32 sourceStartLine = ast->firstSourceLocation().startLine;
|
||||
quint32 statementStartLine;
|
||||
quint32 statementColumn;
|
||||
@@ -165,6 +168,8 @@ public:
|
||||
|
||||
} else if (ast->statement->kind == Node::Kind_Block) {
|
||||
Block *block = static_cast<Block *>(ast->statement);
|
||||
if (!block || !block->statements)
|
||||
return true;
|
||||
statementStartLine = block->statements->firstSourceLocation().
|
||||
startLine;
|
||||
statementColumn = block->statements->firstSourceLocation().
|
||||
|
||||
Reference in New Issue
Block a user