From: Gunnar Beutner Date: Tue, 22 Sep 2015 11:02:35 +0000 (+0200) Subject: Fix: null + null should not be "" X-Git-Tag: v2.4.0~300 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=48bdd0ebf468561561a8a6f909395d6480366f60;p=icinga2 Fix: null + null should not be "" fixes #10192 --- diff --git a/lib/base/value-operators.cpp b/lib/base/value-operators.cpp index 46d50a5e2..05f33de49 100644 --- a/lib/base/value-operators.cpp +++ b/lib/base/value-operators.cpp @@ -230,18 +230,18 @@ Value icinga::operator+(const Value& lhs, const Value& rhs) { if ((lhs.IsEmpty() || lhs.IsNumber()) && !lhs.IsString() && (rhs.IsEmpty() || rhs.IsNumber()) && !rhs.IsString() && !(lhs.IsEmpty() && rhs.IsEmpty())) return static_cast(lhs) + static_cast(rhs); - if ((lhs.IsString() || lhs.IsEmpty() || lhs.IsNumber()) && (rhs.IsString() || rhs.IsEmpty() || rhs.IsNumber())) + if ((lhs.IsString() || lhs.IsEmpty() || lhs.IsNumber()) && (rhs.IsString() || rhs.IsEmpty() || rhs.IsNumber()) && (!(lhs.IsEmpty() && rhs.IsEmpty()) || lhs.IsString() || rhs.IsString())) return static_cast(lhs) + static_cast(rhs); - else if ((lhs.IsNumber() || lhs.IsEmpty()) && (rhs.IsNumber() || rhs.IsEmpty()) && !(lhs.IsEmpty() && rhs.IsEmpty())) + else if ((lhs.IsNumber() || lhs.IsEmpty()) && (rhs.IsNumber() || rhs.IsEmpty()) && !(lhs.IsEmpty() && rhs.IsEmpty()) && !(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())) { + else if ((lhs.IsObjectType() || lhs.IsEmpty()) && (rhs.IsObjectType() || rhs.IsEmpty()) && !(lhs.IsEmpty() && rhs.IsEmpty()) && !(lhs.IsEmpty() && rhs.IsEmpty())) { Array::Ptr result = new Array(); if (!lhs.IsEmpty()) static_cast(lhs)->CopyTo(result); if (!rhs.IsEmpty()) static_cast(rhs)->CopyTo(result); return result; - } else if ((lhs.IsObjectType() || lhs.IsEmpty()) && (rhs.IsObjectType() || rhs.IsEmpty()) && !(lhs.IsEmpty() && rhs.IsEmpty())) { + } else if ((lhs.IsObjectType() || lhs.IsEmpty()) && (rhs.IsObjectType() || rhs.IsEmpty()) && !(lhs.IsEmpty() && rhs.IsEmpty()) && !(lhs.IsEmpty() && rhs.IsEmpty())) { Dictionary::Ptr result = new Dictionary(); if (!lhs.IsEmpty()) static_cast(lhs)->CopyTo(result);