From 4bb978639c26b15235bdfe3f11a54b24e1293c76 Mon Sep 17 00:00:00 2001 From: ConfusedPolarBear <33811686+ConfusedPolarBear@users.noreply.github.com> Date: Tue, 29 Nov 2022 20:31:41 -0600 Subject: [PATCH] Don't run chapter analyzer with an empty regex --- .../Analyzers/ChapterAnalyzer.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/Analyzers/ChapterAnalyzer.cs b/ConfusedPolarBear.Plugin.IntroSkipper/Analyzers/ChapterAnalyzer.cs index 5accbb4..558c0e9 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/Analyzers/ChapterAnalyzer.cs +++ b/ConfusedPolarBear.Plugin.IntroSkipper/Analyzers/ChapterAnalyzer.cs @@ -38,6 +38,11 @@ public ReadOnlyCollection AnalyzeMediaFiles( Plugin.Instance!.Configuration.ChapterAnalyzerIntroductionPattern : Plugin.Instance!.Configuration.ChapterAnalyzerEndCreditsPattern; + if (string.IsNullOrWhiteSpace(expression)) + { + return analysisQueue; + } + foreach (var episode in analysisQueue) { if (cancellationToken.IsCancellationRequested)