xenesty / AkashaScanner

A Genshin Impact tool to export achievements, characters, artifacts, and weapons.
MIT License
84 stars 11 forks source link

Crash on exporting artifacts #33

Open Vievin opened 11 months ago

Vievin commented 11 months ago

Describe the bug When attempting to export artifact data, the scanner crashes.

To Reproduce

  1. (Optional) Farm Hunter and Troupe artifacts and put some on characters
  2. Open AkashaScanner and update artifacts, then scan your artifacts
  3. Click "export in GOOD format"
  4. See error

Expected behavior The data is exported.

Error Message System.Collections.Generic.KeyNotFoundException: The given key 'Invalid' was not present in the dictionary. at System.Collections.Generic.Dictionary2.get_Item(TKey key) at AkashaScanner.Core.Exporters.GoodExporter.Export(String& output, IDataFile1 weaponFile, IDataFile1 artifactFile, IDataFile1 characterFile) in C:\Users\Kith\workspace\AkashaScanner\AkashaScanner\Core\Exporters\GoodExporter.cs:line 110 at AkashaScanner.Ui.Pages.Exports.GoodExports.HandleSubmit() at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task) at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState) at Microsoft.AspNetCore.Components.WebView.IpcSender.<>c__DisplayClass9_0.b1() at Microsoft.AspNetCore.Components.WebView.WindowsForms.WindowsFormsDispatcher.InvokeAsync(Action workItem) at Microsoft.AspNetCore.Components.WebView.WindowsForms.WindowsFormsDispatcher.<>c.<.cctor>b8_0(Exception exception)

Additional context Character export with both Lyney and Lynette owned works fine, "lyney" and "lynette" keys exist in the character export. Weapons and characters export not enabled still results in crash. Rescanned twice, got same result. All scans were successful and not interrupted. Game data was properly updated (twice, just to be sure). Artifact export worked fine on Aug 2. Traveler name was input correctly, Wanderer is not owned.

Cakku commented 11 months ago

You can work around this by opening your ScannedData directory in akashaScanner directory and open the artifacts_date.json, ctrl+f for "Invalid" and replace it with valid stat type. Look at the other items for examples of valid stat names.