Configure: crash when id in patch.js is wrong
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 766
- Forks
- 51
- Avg merge
- 16d 14h
- Merged PRs (30d)
- 1
Description
When the id in patch.js is wrong, thcrap_configure_v3 crashes at this line: https://github.com/thpatch/thcrap/blob/ffc4277150946c8a33695b44cd272855e47dd9b6/thcrap_configure_v3/MainWindow.xaml.cs#LL105C15-L105C15
knownPatches contains the patch names from the various repo.js files, and the id variable comes from patch_bootstrap and contains the id from patch.js. That id isn't in knownPatches, so the function knownPatches.First() throws an exception because it didn't find anything.
Something is wrong and we don't need to make things work in this case, but a readable error message would be better than a crash.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in thcrap_configure_v3/MainWindow.xaml.cs at the referenced line and trace how the id from patch_bootstrap is looked up in knownPatches. Confirm the behavior with an invalid id from patch.js; done means the configuration tool reports a readable error instead of crashing when no patch matches.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, javascript
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100