Skip to content

Commit

Permalink
Handle case when "Created" in output of images list command is absent
Browse files Browse the repository at this point in the history
  • Loading branch information
SgtSilvio committed Feb 28, 2024
1 parent 019faf3 commit 15b0671
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/src/main/java/org/testcontainers/images/ImageData.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ static ImageData from(InspectImageResponse inspectImageResponse) {
}

static ImageData from(Image image) {
return ImageData.builder().createdAt(Instant.ofEpochSecond(image.getCreated())).build();
final Long created = image.getCreated();
final Instant createdInstant = (created == null) ? Instant.EPOCH : Instant.ofEpochSecond(created);
return ImageData.builder().createdAt(createdInstant).build();
}
}

0 comments on commit 15b0671

Please sign in to comment.