fix coverity issue

This commit is contained in:
wmayer
2017-11-18 16:30:27 +01:00
parent c770ce7a34
commit 532d9b230b

View File

@@ -1035,9 +1035,14 @@ Expression * FunctionExpression::eval() const
}
case HYPOT:
case CATH:
if (v2 == 0)
throw ExpressionError("Invalid second argument.");
if (v1->getUnit() != v2->getUnit())
throw ExpressionError("Units must be equal");
if (args.size() > 2) {
if (v3 == 0)
throw ExpressionError("Invalid second argument.");
if (v2->getUnit() != v3->getUnit())
throw ExpressionError("Units must be equal");
}