Fix when writing subchannel in Aaru Format that doesn't belong to any track. Fixes #421

This commit is contained in:
2020-11-06 21:47:35 +00:00
parent d0a9399af6
commit 15219d38d4

View File

@@ -4242,8 +4242,9 @@ namespace Aaru.DiscImages
track = Tracks.FirstOrDefault(trk => sectorAddress >= trk.TrackStartSector &&
sectorAddress <= trk.TrackEndSector);
if(track.TrackSequence == 0 &&
track.TrackStartSector == 0 &&
if(track != null &&
track.TrackSequence == 0 &&
track.TrackStartSector == 0 &&
track.TrackEndSector == 0)
track.TrackType = TrackType.Data;