diff --git a/Generators/GeneratorObjects/src/HepMcParticleLink.cxx b/Generators/GeneratorObjects/src/HepMcParticleLink.cxx
index bdf672d83eded2de831506de911f82a455ea67c9..8bbcfddf44157596c225d276715614e450e838fa 100644
--- a/Generators/GeneratorObjects/src/HepMcParticleLink.cxx
+++ b/Generators/GeneratorObjects/src/HepMcParticleLink.cxx
@@ -222,6 +222,8 @@ HepMcParticleLink::index_type HepMcParticleLink::eventIndex() const
   index_type index, position;
   m_extBarcode.eventIndex (index, position);
   if (index == ExtendedBarCode::UNDEFINED) {
+    // Don't trip the assertion for a null link.
+    if (barcode() == 0) return 0;
     cptr();
     m_extBarcode.eventIndex (index, position);
     assert (index != ExtendedBarCode::UNDEFINED);