From abb15689b820981463c9861d98b285e87977e08d Mon Sep 17 00:00:00 2001
From: Peter Van Gemmeren <peter.van.gemmeren@cern.ch>
Date: Thu, 11 Jun 2020 09:46:29 +0000
Subject: [PATCH] Fix for SharedReader to handle aux store without container
 name

---
 .../AthenaPOOL/AthenaPoolCnvSvc/src/AuxDiscoverySvc.cxx     | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AuxDiscoverySvc.cxx b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AuxDiscoverySvc.cxx
index 17b82a6ba94..a45a0580a3a 100644
--- a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AuxDiscoverySvc.cxx
+++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AuxDiscoverySvc.cxx
@@ -39,7 +39,7 @@ bool AuxDiscoverySvc::getAuxStore(void* obj, const Guid& classId, const std::str
    if (info == nullptr) {
       return false;
    }
-   if ((contId.size() < 5 || contId.substr(contId.size() - 5, 4) != "Aux.")
+   if (!contId.empty() && (contId.size() < 5 || contId.substr(contId.size() - 5, 4) != "Aux.")
 	   && !info->clazz().Properties().HasProperty("IAuxStore")) {
       return false;
    }
@@ -110,7 +110,7 @@ AuxDiscoverySvc::getAuxIDs(const void* obj, const Guid& classId, const std::stri
    if (info == nullptr) {
       return SG::auxid_set_t();
    }
-   if ((contId.size() < 5 || contId.substr(contId.size() - 5, 4) != "Aux.")
+   if (!contId.empty() && (contId.size() < 5 || contId.substr(contId.size() - 5, 4) != "Aux.")
 	   && !info->clazz().Properties().HasProperty("IAuxStore")) {
       return SG::auxid_set_t();
    }
@@ -171,7 +171,7 @@ StatusCode AuxDiscoverySvc::receiveStore(const IAthenaSerializeSvc* serSvc, cons
       return(StatusCode::FAILURE);
    }
    const std::string contName = std::string(static_cast<char*>(buffer));
-   if (classId != Guid::null() && !contName.empty() && this->getAuxStore(obj, classId, contName)) {
+   if (classId != Guid::null() && this->getAuxStore(obj, classId, contName)) {
       void* attrName = nullptr;
       void* typeName = nullptr;
       void* elemName = nullptr;
-- 
GitLab