diff --git a/lib/checkother.cpp b/lib/checkother.cpp index a9089f999..733f000a8 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -2242,7 +2242,7 @@ static bool isWithoutSideEffects(const Tokenizer *tokenizer, const Token* tok) while (tok && tok->astOperand2() && tok->astOperand2()->str() != "(") tok = tok->astOperand2(); - if (tok->varId()) { + if (tok && tok->varId()) { const Variable* var = tok->variable(); return var && (!var->isClass() || var->isPointer() || var->isStlType()); }