diff --git a/src/SIL.Machine/Scripture/ScriptureRangeParser.cs b/src/SIL.Machine/Scripture/ScriptureRangeParser.cs index bad5211e0..ddd40ca50 100644 --- a/src/SIL.Machine/Scripture/ScriptureRangeParser.cs +++ b/src/SIL.Machine/Scripture/ScriptureRangeParser.cs @@ -151,6 +151,11 @@ public Dictionary> GetChapters(string chapterSelections) Dictionary> chaptersPerBook = new Dictionary>(); chapterSelections = chapterSelections.Trim(); + if (chapterSelections.Length == 0) + { + return chaptersPerBook; + } + char delimiter = ';'; if (chapterSelections.Contains(';')) { diff --git a/tests/SIL.Machine.Tests/Scripture/ScriptureRangeParserTests.cs b/tests/SIL.Machine.Tests/Scripture/ScriptureRangeParserTests.cs index efc597b01..13da8cabb 100644 --- a/tests/SIL.Machine.Tests/Scripture/ScriptureRangeParserTests.cs +++ b/tests/SIL.Machine.Tests/Scripture/ScriptureRangeParserTests.cs @@ -177,6 +177,7 @@ public static IEnumerable GetCases() new Dictionary> { { "JHN", new List() } }, false ); + yield return new TestCaseData("", new Dictionary>(), false); //*Throw exceptions yield return new TestCaseData("MAT3-1", new Dictionary>(), true); @@ -185,7 +186,6 @@ public static IEnumerable GetCases() yield return new TestCaseData("MAT0-10", new Dictionary>(), true); yield return new TestCaseData("MAT-FLUM", new Dictionary>(), true); yield return new TestCaseData("-MAT-FLUM", new Dictionary>(), true); - yield return new TestCaseData("", new Dictionary>(), true); yield return new TestCaseData("ABC", new Dictionary>(), true); yield return new TestCaseData("MAT-ABC", new Dictionary>(), true); yield return new TestCaseData("NT;-ABC-LUK", new Dictionary>(), true);