also handle SWTException when loading images
https://bugs.eclipse.org/bugs/show_bug.cgi?id=390136
Signed-off-by: Florian Thienel <florian@thienel.org>
diff --git a/org.eclipse.vex.ui/src/org/eclipse/vex/ui/internal/swt/SwtGraphics.java b/org.eclipse.vex.ui/src/org/eclipse/vex/ui/internal/swt/SwtGraphics.java
index ef79033..22bb46e 100644
--- a/org.eclipse.vex.ui/src/org/eclipse/vex/ui/internal/swt/SwtGraphics.java
+++ b/org.eclipse.vex.ui/src/org/eclipse/vex/ui/internal/swt/SwtGraphics.java
@@ -20,6 +20,7 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.ImageData;
@@ -154,6 +155,9 @@
} finally {
in.close();
}
+ } catch (final SWTException e) {
+ VexPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, VexPlugin.ID, MessageFormat.format("Cannot load image from url: {0}", url), e));
+ return null;
} catch (final IOException e) {
VexPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, VexPlugin.ID, MessageFormat.format("Cannot load image from url: {0}", url), e));
return null;