gibaBR / Switch-Backup-Manager

Complete Switch Backups management tool
375 stars 54 forks source link

fix XCI files skipped when version number is non standard, fix #42 #44

Closed garoxas closed 6 years ago

garoxas commented 6 years ago

this is just a quick fix for #42 to prevent exception occurs while iterating XCI files with invalid version number (Wonder Boy: The Dragons Trap US version with Title ID 0100256006BF8000 for example) ideally I need to know the root cause of this issue, but since I didn't get any volunteers that willing to get me the files I needed (or even the version string for the game), so I just came up with dirty solution like this

I simply removed non supported characters in the version string to prevent Version.Parse throw an exception, however this might not work properly if for example there 2 control.nacp in the XCI with the following version numbers, 1.0.0a and 1.0.0b because I simply removed everything but number and decimal symbol, both will end up as version 1.0.0

but at least, no more missing XCI this way. it's just the version number will not be reported correctly

edit already know the cause, as I expected the version number characters other than numbers, e.g. 1.0.3e and it breaks the Version.Parse functionality this fix should be good to handle that