Skip to content

Commit e219103

Browse files
authored
Added a null check for the optional converter (#2485)
1 parent 98fbcc6 commit e219103

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/main/java/com/comphenix/protocol/wrappers/Converters.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ public Object getGeneric(Optional<T> specific) {
168168

169169
@Override
170170
public Optional<T> getSpecific(Object generic) {
171+
if (generic == null) return Optional.empty();
171172
Optional<Object> optional = (Optional<Object>) generic;
172173
return optional.map(converter::getSpecific);
173174
}

0 commit comments

Comments
 (0)