File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
src/main/java/app/freerouting/gui Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -374,7 +374,11 @@ private void ExportBoardToFile(String filename) {
374374 int cancelButtonIndex = -1 ;
375375 for (Component c : optionPane .getComponents ())
376376 // Ensure there are buttons on the panel
377- if (c instanceof JPanel && ((JPanel )c ).getComponents ()[0 ] instanceof JButton && ((JPanel )c ).getComponents ()[1 ] instanceof JButton ){
377+ if (c instanceof JPanel
378+ && ((JPanel )c ).getComponents ().length >= 2
379+ && ((JPanel )c ).getComponents ()[0 ] instanceof JButton
380+ && ((JPanel )c ).getComponents ()[1 ] instanceof JButton
381+ ){
378382 optionPanel = (JPanel )c ;
379383
380384 JButton firstButton = (JButton )optionPanel .getComponents ()[0 ];
@@ -396,8 +400,9 @@ private void ExportBoardToFile(String filename) {
396400 }
397401
398402 // Set the default button to "Start now"
403+ JButton startButton ;
399404 if ((optionPanel != null ) && (startButtonIndex >= 0 )) {
400- JButton startButton = (JButton ) (optionPanel .getComponents ()[startButtonIndex ]);
405+ startButton = (JButton ) (optionPanel .getComponents ()[startButtonIndex ]);
401406 startButton .setText (resources .getString ("auto_start_routing_startnow_button" ));
402407 startButton .addActionListener (
403408 e -> {
You can’t perform that action at this time.
0 commit comments