diff --git a/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/ReadHandle.icc b/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/ReadHandle.icc index f5611d1d08da578b797e342db0e312d77f6119a7..4678bc4337480d9e6d8f675e0f00065200ca7e8e 100644 --- a/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/ReadHandle.icc +++ b/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/ReadHandle.icc @@ -196,7 +196,10 @@ template <class T> bool ReadHandle<T>::isPresent_impl (const std::string& key) const { const T *result = nullptr; - return xAOD::TActiveEvent::event()->retrieve (result, key, true); + xAOD::TVirtualEvent* event = xAOD::TActiveEvent::event(); + if(event == nullptr) + throw std::runtime_error ("No active event present! ReadHandles cannot be used."); + return event->retrieve (result, key, true); }