From 9d098482dddab38189a7def22827b8d43a30d653 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Thu, 30 Jul 2015 20:01:08 +0200 Subject: [PATCH] Fix: Operator - should not work with "" and numbers fixes #9793 --- lib/base/value-operators.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/base/value-operators.cpp b/lib/base/value-operators.cpp index 7c25188c7..f53bbda6a 100644 --- a/lib/base/value-operators.cpp +++ b/lib/base/value-operators.cpp @@ -275,7 +275,7 @@ Value icinga::operator+(int lhs, const Value& rhs) Value icinga::operator-(const Value& lhs, const Value& rhs) { - if ((lhs.IsNumber() || lhs.IsEmpty()) && (rhs.IsNumber() || rhs.IsEmpty()) && !(lhs.IsEmpty() && rhs.IsEmpty())) + if ((lhs.IsNumber() || lhs.IsEmpty()) && !lhs.IsString() && (rhs.IsNumber() || rhs.IsEmpty()) && !rhs.IsString() && !(lhs.IsEmpty() && rhs.IsEmpty())) return static_cast(lhs) - static_cast(rhs); else if ((lhs.IsObjectType() || lhs.IsEmpty()) && (rhs.IsObjectType() || rhs.IsEmpty()) && !(lhs.IsEmpty() && rhs.IsEmpty())) { if (lhs.IsEmpty()) -- 2.40.0