backport fix for when PhEDEx return SE null

Hi @ticoann, this is the same fix you made this afternoon in #5275, but to be merged only to 0.9.95_plus_patches branch.