Don't use ToDictionary if includeChapters is null#352
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #352 +/- ##
=======================================
Coverage 72.38% 72.38%
=======================================
Files 417 417
Lines 35632 35632
Branches 4928 4929 +1
=======================================
Hits 25793 25793
Misses 8744 8744
Partials 1095 1095 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ddaspit
left a comment
There was a problem hiding this comment.
@ddaspit reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Enkidu93)
src/SIL.Machine/PunctuationAnalysis/ParatextProjectQuoteConventionDetector.cs line 38 at r1 (raw file):
return GetQuoteConventionAnalysis( handler, includeChapters.ToDictionary(kvp => Canon.BookIdToNumber(kvp.Key), kvp => kvp.Value) ?? null
Unless I'm missing something, I don't think this will work. ToDictionary will still throw an exception if includeChapters is null. You need something more like:
includeChapters?.ToDictionary(kvp => Canon.BookIdToNumber(kvp.Key), kvp => kvp.Value)
Enkidu93
left a comment
There was a problem hiding this comment.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @ddaspit)
src/SIL.Machine/PunctuationAnalysis/ParatextProjectQuoteConventionDetector.cs line 38 at r1 (raw file):
Previously, ddaspit (Damien Daspit) wrote…
Unless I'm missing something, I don't think this will work.
ToDictionarywill still throw an exception ifincludeChaptersisnull. You need something more like:includeChapters?.ToDictionary(kvp => Canon.BookIdToNumber(kvp.Key), kvp => kvp.Value)
You aren't missing anything 😆. Just me committing code at the end of a very long day haha. Fixed. Sorry about that. That made less than no sense.
ddaspit
left a comment
There was a problem hiding this comment.
@ddaspit reviewed 1 of 1 files at r2, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @Enkidu93)
d57cf91 to
f59af54
Compare
This change is