Fix crash in ApiEvents::CheckResultAPIHandler

fixes #7577