Skip to content

Commit ab8f9f4

Browse files
meee1Copilot
andauthored
Update Joystick/JoystickSetup.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent b82b7a3 commit ab8f9f4

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Joystick/JoystickSetup.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,11 @@ private void but_import_Click(object sender, EventArgs e)
554554
ofd.Filter = "Joystick config files (*.joycfg)|*.joycfg|All files (*.*)|*.*";
555555
if (ofd.ShowDialog() == DialogResult.OK)
556556
{
557+
if (MainV2.joystick == null)
558+
{
559+
CustomMessageBox.Show("No joystick is currently initialized. Please initialize a joystick before importing a configuration.");
560+
return;
561+
}
557562
MainV2.joystick.ImportConfig(ofd.FileName);
558563
MainV2.joystick.loadconfig();
559564
CustomMessageBox.Show("Please reopen joystick for changes to take effect");

0 commit comments

Comments
 (0)