Permalink
Browse files

Added null checking to avoid potential null pointer exception on some…

… samsung devices
  • Loading branch information...
benfortuna committed Mar 20, 2016
1 parent 4968e9d commit e76b34b8737ea73914bcefb8e4db4bd0f083edff
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/main/java/net/fortuna/ical4j/util/ResourceLoader.java
@@ -54,7 +54,9 @@
public static URL getResource(String name) {
URL resource = null;
try {
- resource = Thread.currentThread().getContextClassLoader().getResource(name);
+ if (Thread.currentThread().getContextClassLoader() != null) {
+ resource = Thread.currentThread().getContextClassLoader().getResource(name);
+ }
} catch (SecurityException e) {
LOG.info("Unable to access context classloader, using default. " + e.getMessage());
}

0 comments on commit e76b34b

Please sign in to comment.