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

Fix exception on clicking Play before dropdown appears #4028

Merged
merged 1 commit into from
Feb 14, 2024

Conversation

HebaruSan
Copy link
Member

Problem

image

Cause

Main.LaunchGame implicitly assumes its string argument will not be null.

ManageMods.LaunchGameToolStripMenuItem_Click passes menuItem?.Tag as string, which implicitly assumes the menu item's Tag will always be set.

The tag is set in LaunchGameToolStripMenuItem_MouseHover, which is executed when you hover the button, but after a short delay. If you click before the delay is over, the tag is null.

Changes

Now Main.LaunchGame allows a null argument and defaults to the first configured command line.

@HebaruSan HebaruSan added Bug Something is not working as intended GUI Issues affecting the interactive GUI labels Feb 14, 2024
@HebaruSan HebaruSan merged commit 3e56d8e into KSP-CKAN:master Feb 14, 2024
8 checks passed
@HebaruSan HebaruSan deleted the fix/launch-crash branch February 14, 2024 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is not working as intended GUI Issues affecting the interactive GUI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant