thcrap icon indicating copy to clipboard operation
thcrap copied to clipboard

Configure: crash when id in patch.js is wrong

Open brliron opened this issue 1 year ago • 2 comments

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.

brliron avatar May 12 '23 17:05 brliron

if the ID of a patch is already specified by it's folder name in the repo, why is it specified separately in patch.js?

32th-System avatar May 14 '23 14:05 32th-System

That's a good question...

brliron avatar May 14 '23 19:05 brliron