Skip to content

Commit

Permalink
CIRC-2136 fix for npe in check for floating
Browse files Browse the repository at this point in the history
   -- when current process is not a check-in but a page request
  • Loading branch information
nielserik committed Sep 23, 2024
1 parent bf8f964 commit 261420d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/main/java/org/folio/circulation/domain/Item.java
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,9 @@ public String getFloatDestinationLocationId() {
}

public boolean canFloatThroughCheckInServicePoint() {
return getLocation() != null &&
getLocation().isFloatingCollection()
return getLocation() != null
&& getLocation().isFloatingCollection()
&& getFloatDestinationLocation() != null
&& getFloatDestinationLocation().getId() != null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public CompletableFuture<Result<Item>> updateItem(Item item) {
if (item.isInStatus(IN_TRANSIT)) {
write(updatedItemRepresentation, IN_TRANSIT_DESTINATION_SERVICE_POINT_ID,
item.getInTransitDestinationServicePointId());
} else if (item.canFloatThroughCheckInServicePoint()) {
} else if (item.isInStatus(AVAILABLE) && item.canFloatThroughCheckInServicePoint()) {
remove(updatedItemRepresentation, TEMPORARY_LOCATION_ID);
write(updatedItemRepresentation, TEMPORARY_LOCATION_ID,
item.getFloatDestinationLocationId());
Expand Down

0 comments on commit 261420d

Please sign in to comment.