* catch possible NPE
This commit is contained in:
parent
6963eb41eb
commit
7c44c29b11
|
@ -78,14 +78,18 @@ public abstract class CachedResource<T extends Serializable> {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
product = type.cast(element.getValue());
|
if (element != null) {
|
||||||
|
product = type.cast(element.getValue());
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Logger.getLogger(getClass().getName()).log(Level.WARNING, e.getMessage());
|
Logger.getLogger(getClass().getName()).log(Level.WARNING, e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
getCache().put(element);
|
if (element != null) {
|
||||||
|
getCache().put(element);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Logger.getLogger(getClass().getName()).log(Level.WARNING, e.getMessage());
|
Logger.getLogger(getClass().getName()).log(Level.WARNING, e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue