Skip to content

Commit f544db4

Browse files
committed
Nullptr check
1 parent 7f902c6 commit f544db4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/checkclass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2611,7 +2611,7 @@ bool CheckClassImpl::checkConstFunc(const Scope *scope, const Function *func, Me
26112611
if (const Variable* lhsVar = lhs->previous()->variable()) {
26122612
if (!lhsVar->isConst() && lhsVar->isReference() && lhs == lhsVar->nameToken()->next())
26132613
return false;
2614-
if (lhsVar->isPointer() && v->isArray() && !(lhsVar->valueType() && lhsVar->valueType()->isConst(/*indirect*/ 1)))
2614+
if (lhsVar->isPointer() && (v && v->isArray()) && !(lhsVar->valueType() && lhsVar->valueType()->isConst(/*indirect*/ 1)))
26152615
return false;
26162616
}
26172617
}

0 commit comments

Comments
 (0)