Repository navigation
Fix two startup crashes and two failures when deleting or exporting drivers - #470
Merged
Merged
Conversation
Added handling for InvalidDataException in portable settings initialization.
Add error handling for driver export failures.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I found these while reading through the code. I was going to open them as issues, but the fixes were small, so I just fixed them. Each one is in a separate commit and touches a different file.
1. Crash on startup with a broken portable config (
Program.cs)SettingsMigration.UsePortableSettingscan throwInvalidDataException(for example whenRapr.user.configis just<configuration/>). It isn't anIOException, so the filter inMaindoesn't catch it and the app closes on every start. I added it to the filter, so it now falls back to the per-user settings like the other settings errors do.2. Crash or slow start when the exe is at a drive root (
DSEFormHelper.cs)GetSupportedLanguagesearched for"Rapr..resources.dll"(two dots), so it never matched anything. It still walked every folder under the exe, though, and only caughtSecurityException. If you run it fromD:\, it hitsSystem Volume Information, getsUnauthorizedAccessException, and the app dies in DSEForm's static constructor. Now it only checks the direct culture subfolders and ignores access/IO errors.3. Delete/export breaks when sorted by "Driver Files" (
LinqExtensions.cs)Before deleting or exporting, the checked items are sorted with the list's sort columns.
DriverFilesis aList<string>, which isn'tIComparable, so LINQ throws. To repro: show the "Driver Files" column, sort by it, check 2+ drivers, and click Delete. You get the unhandled exception dialog. Non-comparable values are now sorted by their text, the same way the column displays them. I added a few tests inRaprTests/Utils/LinqExtensionsTests.cs.4. Exporting selected drivers stops at the first error (
DSEForm.cs)NativeDriverStore.ExportDriverthrows on failure instead of returning false, and the loop didn't catch it, so one bad driver stopped the whole export. Now each driver is handled separately, the same wayExportAllDriversalready does it.AppVeyor build passes (all 70 tests, including the new ones)