From 3958362a696a57ff209a1eb0c36032ecc54ba36f Mon Sep 17 00:00:00 2001
From: Carsten Patzke <carsten.patzke@desy.de>
Date: Wed, 14 Mar 2018 08:48:07 +0100
Subject: [PATCH] Fixed nullptr issue at error to stream function

---
 common/cpp/include/common/error.h | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/common/cpp/include/common/error.h b/common/cpp/include/common/error.h
index 51f4138bd..403fb579c 100644
--- a/common/cpp/include/common/error.h
+++ b/common/cpp/include/common/error.h
@@ -82,7 +82,13 @@ static inline bool operator != (const Error& lhs, const ErrorTemplateInterface&
 }
 
 static inline std::ostream& operator<<(std::ostream& os, const Error& err) {
-    os << err->Explain();
+    if(err) {
+        os << err->Explain();
+    }
+    else {
+        static std::string no_error = "No error";
+        os << no_error;
+    }
     return os;
 }
 
-- 
GitLab