File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -541,8 +541,21 @@ private void but_export_Click(object sender, EventArgs e)
541541 sfd . Filter = "Joystick config files (*.joycfg)|*.joycfg|All files (*.*)|*.*" ;
542542 if ( sfd . ShowDialog ( ) == DialogResult . OK )
543543 {
544- MainV2 . joystick . saveconfig ( ) ;
545- MainV2 . joystick . ExportConfig ( sfd . FileName ) ;
544+ if ( MainV2 . joystick == null )
545+ {
546+ CustomMessageBox . Show ( "No joystick configuration is available to export." , "Export Joystick Config" , MessageBoxButtons . OK ) ;
547+ return ;
548+ }
549+
550+ try
551+ {
552+ MainV2 . joystick . saveconfig ( ) ;
553+ MainV2 . joystick . ExportConfig ( sfd . FileName ) ;
554+ }
555+ catch ( Exception ex )
556+ {
557+ CustomMessageBox . Show ( "Failed to export joystick configuration:\n " + ex . Message , "Export Joystick Config" , MessageBoxButtons . OK ) ;
558+ }
546559 }
547560 }
548561
You can’t perform that action at this time.
0 commit comments