package net.pterodactylus.sone.data;
+import javax.annotation.Nonnull;
+
import com.google.common.base.Function;
import com.google.common.base.Optional;
public static final Function<Optional<? extends Identified>, Optional<String>> GET_ID = new Function<Optional<? extends Identified>, Optional<String>>() {
@Override
+ @Nonnull
public Optional<String> apply(Optional<? extends Identified> identified) {
- return identified.isPresent() ? Optional.of(identified.get().getId()) : Optional.<String>absent();
+ return (identified == null) ? Optional.<String>absent() : (identified.isPresent() ? Optional.of(identified.get().getId()) : Optional.<String>absent());
}
};