Skip to content

Commit 9442f4a

Browse files
authored
Bugfix for #54: possible null value in PlaneInfoWrapper::getMinPosition (#55)
1 parent 3c370a1 commit 9442f4a

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
<groupId>fr.igred</groupId>
1111
<artifactId>simple-omero-client</artifactId>
12-
<version>5.12.1</version>
12+
<version>5.12.2</version>
1313
<packaging>jar</packaging>
1414

1515
<name>Simple OMERO Client</name>

src/main/java/fr/igred/omero/meta/PlaneInfoWrapper.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import java.util.Collections;
3434
import java.util.Iterator;
3535
import java.util.List;
36+
import java.util.Objects;
3637
import java.util.function.Function;
3738
import java.util.stream.Collectors;
3839

@@ -143,6 +144,7 @@ public static Length getMinPosition(Collection<? extends PlaneInfoWrapper> plane
143144
List<Double> positions = planesInfo.stream()
144145
.map(getter)
145146
.map(UnitsFactory::convertLength)
147+
.filter(Objects::nonNull)
146148
.map(p -> p.value(unit).doubleValue())
147149
.collect(Collectors.toList());
148150
Double pos = positions.isEmpty() ? 0.0d : Collections.min(positions);

0 commit comments

Comments
 (0)