diff --git a/lib/checkunusedvar.cpp b/lib/checkunusedvar.cpp index cc5421df4..630b01d8b 100644 --- a/lib/checkunusedvar.cpp +++ b/lib/checkunusedvar.cpp @@ -1127,7 +1127,7 @@ void CheckUnusedVar::checkFunctionVariableUsage() unreadVariableError(usage._lastAccess, varname); // variable has been read but not written - else if (!usage._write && !usage._allocateMemory && !var->isStlType() && var && !isEmptyType(var->type())) + else if (!usage._write && !usage._allocateMemory && var && !var->isStlType() && !isEmptyType(var->type())) unassignedVariableError(usage._var->nameToken(), varname); } }