protect against zero good detid
Merged refs/pull/2466/head from repository cms-sw