Do not dereference handle, before its validity is checked.
Merge pull request #6486 from vadler/73X-fixHadronAndPartonSelectorForUnknownGenerators

73X - fix `HadronAndPartonSelector` for unknown generators