Ignore:
Timestamp:
2018-04-19T20:37:16+02:00 (6 years ago)
Author:
Don-vip
Message:

see #16204 - Allow to start and close JOSM in WebStart sandbox mode (where every external access is denied). This was very useful to reproduce some very tricky bugs that occured in real life but were almost impossible to diagnose.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/JosmAction.java

    r13611 r13647  
    3636import org.openstreetmap.josm.tools.Destroyable;
    3737import org.openstreetmap.josm.tools.ImageProvider;
     38import org.openstreetmap.josm.tools.ImageResource;
    3839import org.openstreetmap.josm.tools.Logging;
    3940import org.openstreetmap.josm.tools.Shortcut;
     
    8182            String toolbarId, boolean installAdapters) {
    8283        super(name);
    83         if (icon != null)
    84             icon.getResource().attachImageIcon(this, true);
     84        if (icon != null) {
     85            ImageResource resource = icon.getResource();
     86            if (resource != null) {
     87                resource.attachImageIcon(this, true);
     88            }
     89        }
    8590        setHelpId();
    8691        sc = shortcut;
     
    119124    public JosmAction(String name, String iconName, String tooltip, Shortcut shortcut, boolean registerInToolbar,
    120125            String toolbarId, boolean installAdapters) {
    121         this(name, iconName == null ? null : new ImageProvider(iconName), tooltip, shortcut, registerInToolbar,
     126        this(name, iconName == null ? null : new ImageProvider(iconName).setOptional(true), tooltip, shortcut, registerInToolbar,
    122127                toolbarId == null ? iconName : toolbarId, installAdapters);
    123128    }
Note: See TracChangeset for help on using the changeset viewer.