Skip to content

Commit

Permalink
Added null checking to avoid potential null pointer exception on some…
Browse files Browse the repository at this point in the history
… samsung devices
  • Loading branch information
benfortuna committed Mar 20, 2016
1 parent 4968e9d commit e76b34b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/net/fortuna/ical4j/util/ResourceLoader.java
Expand Up @@ -54,7 +54,9 @@ public class ResourceLoader {
public static URL getResource(String name) { public static URL getResource(String name) {
URL resource = null; URL resource = null;
try { try {
resource = Thread.currentThread().getContextClassLoader().getResource(name); if (Thread.currentThread().getContextClassLoader() != null) {
resource = Thread.currentThread().getContextClassLoader().getResource(name);
}
} catch (SecurityException e) { } catch (SecurityException e) {
LOG.info("Unable to access context classloader, using default. " + e.getMessage()); LOG.info("Unable to access context classloader, using default. " + e.getMessage());
} }
Expand Down

0 comments on commit e76b34b

Please sign in to comment.