- Timestamp:
- 2022-03-08T15:52:28+01:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/MapImage.java
r17144 r18388 140 140 if (img == null) 141 141 getImage(); // fix #7498 ? 142 Image disImg = GuiHelper.getDisabledImage(img); 143 if (disImg instanceof BufferedImage) { 144 disabledImgCache = (BufferedImage) disImg; 145 } else { 146 disabledImgCache = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_ARGB); 147 Graphics g = disabledImgCache.getGraphics(); 148 g.drawImage(disImg, 0, 0, null); 149 g.dispose(); 142 // This should fix #21919: NPE due to disabledImgCache being null (race condition with #loadImage()) 143 synchronized (this) { 144 Image disImg = GuiHelper.getDisabledImage(img); 145 if (disImg instanceof BufferedImage) { 146 disabledImgCache = (BufferedImage) disImg; 147 } else { 148 disabledImgCache = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_ARGB); 149 Graphics g = disabledImgCache.getGraphics(); 150 g.drawImage(disImg, 0, 0, null); 151 g.dispose(); 152 } 150 153 } 151 154 return disabledImgCache;
Note:
See TracChangeset
for help on using the changeset viewer.