From: Gunnar Beutner <gunnar.beutner@netways.de>
Date: Thu, 1 Sep 2016 13:25:14 +0000 (+0200)
Subject: Fix move assignment operator for the String class
X-Git-Tag: v2.6.0~135
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b5d4d9aba3e3cab41386463ea091e46576b31b70;p=icinga2

Fix move assignment operator for the String class

fixes #12619
---

diff --git a/lib/base/string.cpp b/lib/base/string.cpp
index 4474e4d6b..e8b9dbfe3 100644
--- a/lib/base/string.cpp
+++ b/lib/base/string.cpp
@@ -38,10 +38,8 @@ String::String(Value&& other)
 
 String& String::operator=(Value&& other)
 {
-	const String *p = other.GetPtr<String>();
-
-	if (p)
-		m_Data = std::move(p->m_Data);
+	if (other.IsString())
+		m_Data = std::move(other.Get<String>());
 	else
 		m_Data = other;