Changeset 33100 in osm for applications/editors/josm


Ignore:
Timestamp:
2016-12-09T23:03:01+01:00 (8 years ago)
Author:
donvip
Message:

fix IAE seen in JOSM integration tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/print/src/org/openstreetmap/josm/plugins/print/PrintPlugin.java

    r33096 r33100  
    4747        } while (fileMenu != null && pos > 2 && fileMenu.getItem(pos) != null);
    4848
    49         PrintAction printAction = new PrintAction();
    50         printMenu = fileMenu.insert(printAction, pos);
    51         printMenu.setEnabled(false);
    52         printMenu.setVisible(true);
     49        if (pos > 0) {
     50            PrintAction printAction = new PrintAction();
     51            printMenu = fileMenu.insert(printAction, pos);
     52            printMenu.setEnabled(false);
     53            printMenu.setVisible(true);
    5354
    54         KeyStroke ks = printAction.getShortcut().getKeyStroke();
    55         if (ks != null) {
    56             printMenu.setAccelerator(ks);
     55            KeyStroke ks = printAction.getShortcut().getKeyStroke();
     56            if (ks != null) {
     57                printMenu.setAccelerator(ks);
     58            }
     59
     60            fileMenu.insertSeparator(pos);
    5761        }
    58 
    59         fileMenu.insertSeparator(pos);
    6062
    6163        restorePrefs(); // Recover after crash if necessary
Note: See TracChangeset for help on using the changeset viewer.