Skip to content
Permalink
Browse files
6833: Tolerate exceptions when loading images
Reviewed-by: hirt
  • Loading branch information
cimi authored and thegreystone committed Jun 24, 2020
1 parent 2edae36 commit 77d4b13a3818dd468723ff8bb86bcb8433888060
@@ -38,6 +38,7 @@
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.ToolBarManager;
import org.eclipse.jface.preference.JFacePreferences;
import org.eclipse.jface.resource.DeviceResourceException;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.resource.LocalResourceManager;
@@ -77,7 +78,14 @@ public String getToolTipText(Object element) {
@Override
public Image getImage(Object element) {
ImageDescriptor icon = ((IAction) element).getImageDescriptor();
return icon == null ? null : manager.createImage(icon);
try {
if (icon != null) {
return manager.createImage(icon);
}
} catch (DeviceResourceException e) {
return null;
}
return null;
}

@Override

0 comments on commit 77d4b13

Please sign in to comment.