From 11d778d8817352545fd6dfed95b3328d1fbcd733 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Tue, 22 Sep 2015 11:24:00 +0200 Subject: [PATCH] Fix: String methods cannot be invoked on an empty string fixes #10191 --- lib/config/vmops.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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())