Changeset 11323 in josm for trunk/src


Ignore:
Timestamp:
2016-11-27T02:52:18+01:00 (8 years ago)
Author:
Don-vip
Message:

fix #14016 - NPE

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/io/SaveLayersDialog.java

    r11101 r11323  
    447447        private static final int ICON_SIZE = 24;
    448448        private static final String BASE_ICON = "BASE_ICON";
    449         private final transient Image save = ImageProvider.get("save").getImage();
    450         private final transient Image upld = ImageProvider.get("upload").getImage();
    451         private final transient Image saveDis = new ImageProvider("save").setDisabled(true).get().getImage();
    452         private final transient Image upldDis = new ImageProvider("upload").setDisabled(true).get().getImage();
     449        private final transient Image save = getImage("save", false);
     450        private final transient Image upld = getImage("upload", false);
     451        private final transient Image saveDis = getImage("save", true);
     452        private final transient Image upldDis = getImage("upload", true);
    453453
    454454        SaveAndProceedAction() {
    455455            initForReason(Reason.EXIT);
     456        }
     457
     458        Image getImage(String name, boolean disabled) {
     459            ImageIcon img = new ImageProvider(name).setDisabled(disabled).get();
     460            return img != null ? img.getImage() : null;
    456461        }
    457462
Note: See TracChangeset for help on using the changeset viewer.