Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update registry at start of GUI if available_modules is empty #2241

Merged
merged 1 commit into from Jan 5, 2018

Conversation

HebaruSan
Copy link
Member

Problem

If the registry's available_modules list is empty while GUI is trying to use it, null reference exceptions can occur.
See #1994 and KSP-CKAN/NetKAN#5907 for examples.

Relevant side notes

The GUI already auto-refreshes the available_modules list at startup if configuration.RefreshOnStartup is true.

available_modules is empty by default when first adding a new instance, which we handle by setting configuration.RefreshOnStartup to true for such a newly added instance, so the registry will be loaded when we get to that part of the initialization.

Changes

Now the GUI performs its registry auto-refresh in one more situation: when available_modules is empty. This ensures that we will re-download the registry if we need to.

Linkages

Closes #2115. After looking at that pull request, I don't think the approach is workable; Create resets the registry completely, which we do not want in this case because information about installed modules and source repositories is lost. And it doesn't solve the problem; if configuration.RefreshOnStartup is false, then available_modules would stay empty and the app would still crash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Pull request Registry Issues affecting the registry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants