Skip to content

Commit e84e60d

Browse files
Update checknullpointer.cpp
1 parent 19dd97c commit e84e60d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/checknullpointer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ void CheckNullPointer::nullPointerByDeRefAndCheck()
310310

311311
return true;
312312
};
313-
const Token* const start = scope->function->isConstructor() ? scope->function->token : scope->bodyStart; // Check initialization list
313+
const Token* const start = (scope->function && scope->function->isConstructor()) ? scope->function->token : scope->bodyStart; // Check initialization list
314314
std::vector<const Token *> tokens = findTokensSkipDeadAndUnevaluatedCode(mSettings->library, start, scope->bodyEnd, pred);
315315
for (const Token *tok : tokens) {
316316
const ValueFlow::Value *value = tok->getValue(0);

0 commit comments

Comments
 (0)