Skip to content

Asg ReadHandle: Fix segfault when event pointer is null

While trying to debug some unit tests in AnalysisBase I realized that I was getting a segfault from inside ReadHandle::isValid(). It looks like this was occurring because the internal function for this dereferences the active event pointer without checking its validity first (and in my unit test, there's no active event - the ReadHandle in question is supposed to be invalid as part of the test).

This change simply makes the internal isPresent_impl(...) return false instead of segfaulting in this case. This seems like a safe convention: if there's no event to find the object in, it can't be present or valid.

I'm marking this as a bugfix, as this code should presumably never segfault.

Merge request reports

Loading