diff --git a/src/main/java/com/spotify/docker/client/messages/VolumeList.java b/src/main/java/com/spotify/docker/client/messages/VolumeList.java index de7ca7785..9063f6e6b 100644 --- a/src/main/java/com/spotify/docker/client/messages/VolumeList.java +++ b/src/main/java/com/spotify/docker/client/messages/VolumeList.java @@ -36,6 +36,7 @@ @JsonAutoDetect(fieldVisibility = ANY, getterVisibility = NONE, setterVisibility = NONE) public abstract class VolumeList { + @Nullable @JsonProperty("Volumes") public abstract ImmutableList volumes(); @@ -47,8 +48,10 @@ public abstract class VolumeList { static VolumeList create( @JsonProperty("Volumes") final List volumes, @JsonProperty("Warnings") final List warnings) { + final ImmutableList volumesCopy = volumes == null + ? null : ImmutableList.copyOf(volumes); final ImmutableList warningsCopy = warnings == null ? null : ImmutableList.copyOf(warnings); - return new AutoValue_VolumeList(ImmutableList.copyOf(volumes), warningsCopy); + return new AutoValue_VolumeList(volumesCopy, warningsCopy); } }