ofNullable

This commit is contained in:
zhouhao
2017-05-23 19:56:14 +08:00
parent 07d3289db1
commit 602b992bb2

View File

@@ -93,7 +93,7 @@ public class SimpleAuthentication implements Authentication {
@Override
@SuppressWarnings("unchecked")
public <T extends Serializable> Optional<T> getAttribute(String name) {
return Optional.of((T) attributes.get(name));
return Optional.ofNullable((T) attributes.get(name));
}
@Override