mirror of
https://github.com/moparisthebest/davmail
synced 2025-01-05 18:58:02 -05:00
Handle missing resource in loadSwtImage
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@2241 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
c3dabcdfe4
commit
1b7ae604fc
@ -160,6 +160,9 @@ public class SwtGatewayTray implements DavGatewayTrayInterface {
|
||||
try {
|
||||
ClassLoader classloader = DavGatewayTray.class.getClassLoader();
|
||||
URL imageUrl = classloader.getResource(fileName);
|
||||
if (imageUrl == null) {
|
||||
throw new IOException(fileName);
|
||||
}
|
||||
result = new Image(display, imageUrl.openStream());
|
||||
} catch (IOException e) {
|
||||
DavGatewayTray.warn(new BundleMessage("LOG_UNABLE_TO_LOAD_IMAGE"), e);
|
||||
@ -180,7 +183,7 @@ public class SwtGatewayTray implements DavGatewayTrayInterface {
|
||||
final String systemLookAndFeelClassName = UIManager.getSystemLookAndFeelClassName();
|
||||
try {
|
||||
// workaround for bug when SWT and AWT both try to access Gtk
|
||||
if (systemLookAndFeelClassName.indexOf("gtk") >= 0) {
|
||||
if (systemLookAndFeelClassName.contains("gtk")) {
|
||||
System.setProperty("swing.defaultlaf", UIManager.getCrossPlatformLookAndFeelClassName());
|
||||
} else {
|
||||
System.setProperty("swing.defaultlaf", systemLookAndFeelClassName);
|
||||
|
Loading…
Reference in New Issue
Block a user