From 6485587e3a5cf8779be951b4867bb1b717e660c5 Mon Sep 17 00:00:00 2001 From: Silvio Giebl Date: Tue, 16 Jul 2024 12:36:09 +0200 Subject: [PATCH] Add variants.isNotEmpty check to OciImage --- .../kotlin/io/github/sgtsilvio/gradle/oci/OciImagesTask.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/io/github/sgtsilvio/gradle/oci/OciImagesTask.kt b/src/main/kotlin/io/github/sgtsilvio/gradle/oci/OciImagesTask.kt index 95a84cb1..269b9d12 100644 --- a/src/main/kotlin/io/github/sgtsilvio/gradle/oci/OciImagesTask.kt +++ b/src/main/kotlin/io/github/sgtsilvio/gradle/oci/OciImagesTask.kt @@ -38,7 +38,11 @@ internal class OciImage( val config: OciDataDescriptor, val platform: Platform, val variants: List, -) +) { + init { + require(variants.isNotEmpty()) { "variants must not be empty" } + } +} internal class OciVariant( val metadata: OciMetadata,