diff --git a/src/main/java/com/bmuschko/gradle/docker/tasks/image/DockerRemoveImage.java b/src/main/java/com/bmuschko/gradle/docker/tasks/image/DockerRemoveImage.java index 908dbc58..8ba1956a 100644 --- a/src/main/java/com/bmuschko/gradle/docker/tasks/image/DockerRemoveImage.java +++ b/src/main/java/com/bmuschko/gradle/docker/tasks/image/DockerRemoveImage.java @@ -167,6 +167,6 @@ private void removeImage(String imageId) { } private boolean mixesBothProperties() { - return this.images.isPresent() && this.getImageId().isPresent(); + return !this.images.get().isEmpty() && java.util.Optional.ofNullable(this.getImageId().getOrNull()).isPresent(); } }