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:
Aurindam Jana
2012-03-09 08:57:19 +01:00
parent d2b967b781
commit f7caba3923

View File

@@ -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().