From d3352643fc158c112ef5fa1cebbc81f360a46b5e Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Wed, 2 Feb 2022 20:05:15 -0800 Subject: [PATCH] Ensure drive is not null for volume labels (fixes #356) --- CHANGELIST.md | 1 + MPF.Library/InfoTool.cs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELIST.md b/CHANGELIST.md index 9e4f4308..6eaa23a0 100644 --- a/CHANGELIST.md +++ b/CHANGELIST.md @@ -77,6 +77,7 @@ - Ensure Games pseudo-tag is multi-line - Add alternate pseudo-tag for Playable Demos - Make error clearer if something is unsupported in Check +- Ensure drive is not null for volume labels ### 2.2 (2021-12-30) - Fix Saturn header finding diff --git a/MPF.Library/InfoTool.cs b/MPF.Library/InfoTool.cs index 9c767aee..b47273ea 100644 --- a/MPF.Library/InfoTool.cs +++ b/MPF.Library/InfoTool.cs @@ -104,7 +104,8 @@ namespace MPF.Library info.TracksAndWriteOffsets.ClrMameProData = null; // Add the volume label to comments, if possible or necessary - if (drive.GetRedumpSystemFromVolumeLabel() == null + if (drive != null + && drive.GetRedumpSystemFromVolumeLabel() == null && !info.CommonDiscInfo.CommentsSpecialFields.ContainsKey(SiteCode.VolumeLabel)) { info.CommonDiscInfo.CommentsSpecialFields[SiteCode.VolumeLabel] = drive.VolumeLabel;