From dcaaaefdbc041506a4cb7f69eec58141ffc4995d Mon Sep 17 00:00:00 2001 From: MattJackson <1085847+MattJackson@users.noreply.github.com> Date: Tue, 7 Apr 2026 20:36:26 -0700 Subject: [PATCH] =?UTF-8?q?Labels:=20catch=20panics=20=E2=80=94=20never=20?= =?UTF-8?q?break=20disc=20scan?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/labels/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/labels/mod.rs b/src/labels/mod.rs index 858f781..8d46551 100644 --- a/src/labels/mod.rs +++ b/src/labels/mod.rs @@ -78,8 +78,11 @@ const PARSERS: &[(&str, DetectFn, ParseFn)] = &[ ]; /// Search disc for config files, extract labels, apply to streams. +/// This is 100% optional — if anything fails, streams are untouched. pub fn apply(session: &mut DriveSession, udf: &UdfFs, titles: &mut [Title]) { - let labels = extract(session, udf); + let labels = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| { + extract(session, udf) + })).unwrap_or_default(); if labels.is_empty() { return; } for title in titles.iter_mut() {