diff --git a/k4MarlinWrapper/src/components/EDM4hep2Lcio.cpp b/k4MarlinWrapper/src/components/EDM4hep2Lcio.cpp index ac02ee83..793ecb64 100644 --- a/k4MarlinWrapper/src/components/EDM4hep2Lcio.cpp +++ b/k4MarlinWrapper/src/components/EDM4hep2Lcio.cpp @@ -292,12 +292,10 @@ podio::CollectionBase* EDM4hep2LcioTool::getEDM4hepCollection(const std::string& // std::shared_ptr but this has been removed in k4FWCore so it can be deleted // at some point auto uptr = dynamic_cast>*>(p); - AnyDataWrapper>* sptr = nullptr; - if (!uptr) { - sptr = dynamic_cast>*>(p); - } else { + if (uptr) { return uptr->getData().get(); } + auto sptr = dynamic_cast>*>(p); if (sptr) { return sptr->getData().get(); }