diff --git a/lib/checknullpointer.cpp b/lib/checknullpointer.cpp index 12c5bb60e..24db57a34 100644 --- a/lib/checknullpointer.cpp +++ b/lib/checknullpointer.cpp @@ -1400,5 +1400,8 @@ void CheckNullPointer::nullPointerError(const Token *tok, const std::string &var void CheckNullPointer::nullPointerError(const Token *tok, const std::string &varname, const unsigned int line, bool inconclusive) { const std::string errmsg("Possible null pointer dereference: " + varname + " - otherwise it is redundant to check if " + varname + " is null at line " + MathLib::toString(line)); - reportError(tok, Severity::error, "nullPointer", errmsg, inconclusive); + if (inconclusive) + reportInconclusiveError(tok, Severity::error, "nullPointer", errmsg); + else + reportError(tok, Severity::error, "nullPointer", errmsg); }