Skip to content

Implement safer handling of situations when RimWorld has never been run / partially run #299

@BleuSquid

Description

@BleuSquid

On a clean system, I installed RimWorld, and RimSort.
Launching RimSort prompted me to set-up paths as expected, but failed to set-up paths until I launched RimWorld and config files were generated. After launching RimWorld once to generate these paths/files, I was able to set up the paths.

However, closing and re-opening RimSort at this point results in a fatal error in validate_rimworld_mods_list.

It seems that the initial version of the ModsConfig.xml file that RimWorld creates when it is launched is just the XML structure, without any mods listed, including the Core mod. It seems that a new game must actually be started, or the modlist modified in-game before RimWorld creates a version that is usable.

The initial ModsConfig.xml created by RimWorld:

<?xml version="1.0" encoding="utf-8"?>
<ModsConfigData>
	<activeMods>
	</activeMods>
</ModsConfigData>

Trace:

[INFO][2024-04-21 13:13:47][23684][MainThread][main_content_panel][__repopulate_lists][555] : Repopulating mod lists
[INFO][2024-04-21 13:13:47][23684][MainThread][metadata][get_mods_from_list][1834] : Retrieving active mods from RimWorld mod list
[ERROR][2024-04-21 13:13:47][23684][MainThread][__main__][main_thread][99] : The main application instantiation has failed with an uncaught exception:
[ERROR][2024-04-21 13:13:47][23684][MainThread][__main__][main_thread][102] : Traceback (most recent call last):
  File "C:\Users\Aaron\Desktop\RIMSOR~1\RimSort\__main__.py", line 79, in main_thread
  File "C:\Users\Aaron\Desktop\RIMSOR~1\RimSort\app\controllers\app_controller.py", line 56, in run
  File "C:\Users\Aaron\Desktop\RIMSOR~1\RimSort\app\views\main_window.py", line 170, in initialize_content
  File "C:\Users\Aaron\Desktop\RIMSOR~1\RimSort\app\views\main_content_panel.py", line 1009, in _do_refresh
  File "C:\Users\Aaron\Desktop\RIMSOR~1\RimSort\app\views\main_content_panel.py", line 561, in __repopulate_lists
  File "C:\Users\Aaron\Desktop\RIMSOR~1\RimSort\app\utils\metadata.py", line 1836, in get_mods_from_list
  File "C:\Users\Aaron\Desktop\RIMSOR~1\RimSort\app\utils\schema.py", line 20, in validate_rimworld_mods_list
AttributeError: 'NoneType' object has no attribute 'get'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Windows 🪟Windows-specific issuesaccessibility 👀 ℹ️🤓user-friendly optimization, like notifications, warnings and action alertsbugs 🪲bugs and errors, something is not working as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions