From: Gunnar Beutner Date: Tue, 22 Sep 2015 09:24:00 +0000 (+0200) Subject: Fix: String methods cannot be invoked on an empty string X-Git-Tag: v2.3.11~19 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=11d778d8817352545fd6dfed95b3328d1fbcd733;p=icinga2 Fix: String methods cannot be invoked on an empty string fixes #10191 --- diff --git a/lib/config/vmops.hpp b/lib/config/vmops.hpp index 1db10e009..0f517aa8e 100644 --- a/lib/config/vmops.hpp +++ b/lib/config/vmops.hpp @@ -58,7 +58,7 @@ public: { boost::shared_ptr vframe; - if (!self.IsEmpty()) + if (!self.IsEmpty() || self.IsString()) vframe = boost::make_shared(self); /* passes self to the callee using a TLS variable */ else vframe = boost::make_shared(); @@ -206,7 +206,7 @@ public: static inline Value GetField(const Value& context, const String& field, const DebugInfo& debugInfo = DebugInfo()) { - if (context.IsEmpty()) + if (context.IsEmpty() && !context.IsString()) return Empty; if (!context.IsObject())