Skip to content

Comments

Dev#6

Open
austinhrin wants to merge 2 commits intoDestuur:devfrom
austinhrin:dev
Open

Dev#6
austinhrin wants to merge 2 commits intoDestuur:devfrom
austinhrin:dev

Conversation

@austinhrin
Copy link

@austinhrin austinhrin commented Feb 21, 2026

Summary

Fix application crash when user clicks "Start Modding" without having configured the game directory.

When the application is first downloaded, the game directory is not configured by default. Additionally, fresh game installations don't have a "Mods" folder. Attempting to create a new mod in this state caused the application to crash due to:

  • ArgumentNullException from null Perks/Buffs collections in XmlService
  • DirectoryNotFoundException in IconService looking for pak files in wrong location
  • DirectoryNotFoundException in ModService when Mods folder doesn't exist

Changes

  • Initialize Perks and Buffs collections with empty lists in XmlService
  • Add GameDirectory and file existence checks in IconService.GetBase64Icon
  • Validate game directory in NewMod.StartModding with user-friendly snackbar error
  • Add null-safe access to XmlService collections in all ModItem components
  • Create Mods folder automatically if it doesn't exist in InitiateModCollections
  • Skip mod enumeration in DeleteMod if Mods folder doesn't exist

Test plan

  • Launch app without game directory configured
  • Create a new mod and click "Start Modding"
  • Verify error message appears instead of crash
  • Configure game directory in Settings
  • Verify modding flow works normally with fresh game install (no Mods folder)

This resolves "Unset Game Direct cause the crash when create new mod." on nexusmods

Application was crashing due to unhandled exceptions when game directory
was not set:
- ArgumentNullException from null Perks/Buffs collections in XmlService
- DirectoryNotFoundException in IconService looking for pak files

Fixes:
- Initialize Perks and Buffs collections with empty lists in XmlService
- Add GameDirectory and file existence checks in IconService.GetBase64Icon
- Validate game directory in NewMod.StartModding with user-friendly error
- Add null-safe access to XmlService collections in all ModItem components
Game installations don't have a Mods folder by default. Added checks to:
- Create the folder in InitiateModCollections if missing
- Skip enumeration in DeleteMod if folder doesn't exist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant