🚑 Make trainer field fully nullable in PokemongCodec

pull/10/head
Alexis Drai 2 years ago committed by alexis.drai@etu.uca.fr
parent 5a9afb7437
commit 6565b12586

@ -128,8 +128,10 @@ public class PokemongCodec extends GenericCodec<Pokemong> {
.collect(Collectors.toList()); .collect(Collectors.toList());
pokemong.setEvoTrack(evoTrack); pokemong.setEvoTrack(evoTrack);
pokemong.setTrainer(document.getObjectId("trainer") ObjectId trainerId = document.getObjectId("trainer");
.toString()); if (trainerId != null) {
pokemong.setTrainer(trainerId.toString());
}
List<Type> types = document.getList("types", Document.class) List<Type> types = document.getList("types", Document.class)
.stream() .stream()

Loading…
Cancel
Save