diff --git a/tracker/agb-xm-core/src/lib.rs b/tracker/agb-xm-core/src/lib.rs index 7b39c1d4..d2ad32fc 100644 --- a/tracker/agb-xm-core/src/lib.rs +++ b/tracker/agb-xm-core/src/lib.rs @@ -112,8 +112,10 @@ pub fn parse_module(module: &Module) -> agb_tracker_interop::Track { } else { let instrument_index = (slot.instrument - 1) as usize; - if let InstrumentType::Default(ref instrument) = - module.instrument[instrument_index].instr_type + if let Some(InstrumentType::Default(ref instrument)) = module + .instrument + .get(instrument_index) + .map(|instrument| &instrument.instr_type) { let sample_slot = *instrument .sample_for_note