Check 'node' for NULL before derefencing it, not after

Change-Id: Iab4b28997d9d13645375284083e4e603e02cec5c
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Martin Smith <martin.smith@digia.com>
This commit is contained in:
Montel Laurent 2013-03-19 10:58:18 +01:00 committed by The Qt Project
parent eb42513a50
commit 4a5182e63d

View File

@ -867,8 +867,8 @@ void CppCodeParser::processOtherMetaCommand(const Doc& doc,
}
}
else if (command == COMMAND_REIMP) {
if (node->parent() && !node->parent()->isInternal()) {
if (node != 0 && node->type() == Node::Function) {
if (node != 0 && node->parent() && !node->parent()->isInternal()) {
if (node->type() == Node::Function) {
FunctionNode *func = (FunctionNode *) node;
const FunctionNode *from = func->reimplementedFrom();
if (from == 0) {