Follow-up from #336 (review thread r3445099496).
#336 added if (isEmpty(parts[1])) return null before the MMSI substring, which drops empty-MMSI frames ($CDDSC,12,,,07,,,,,,*57) and the bare-$CDDSC,12 TypeError. But a sparse frame with a non-empty but non-numeric MMSI still gets through:
isEmpty is false, so parts[1]!.substring(0, 9) runs on ABC and produces a malformed vessels.urn:mrn:imo:mmsi:ABC context.
Fix is to tighten the parts[1] guard from empty-check to a numeric check (MMSI is always digits per ITU-R M.493). Left out of #336 to keep that PR scoped to distress-alert recognition.
🤖 Generated with Claude Code
Follow-up from #336 (review thread r3445099496).
#336 added
if (isEmpty(parts[1])) return nullbefore the MMSI substring, which drops empty-MMSI frames ($CDDSC,12,,,07,,,,,,*57) and the bare-$CDDSC,12TypeError. But a sparse frame with a non-empty but non-numeric MMSI still gets through:isEmptyis false, soparts[1]!.substring(0, 9)runs onABCand produces a malformedvessels.urn:mrn:imo:mmsi:ABCcontext.Fix is to tighten the
parts[1]guard from empty-check to a numeric check (MMSI is always digits per ITU-R M.493). Left out of #336 to keep that PR scoped to distress-alert recognition.🤖 Generated with Claude Code