From 391df0c4a34886688177ed8779ca26c189280fdb Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Sun, 27 Mar 2016 09:46:34 -0700 Subject: [PATCH] Better error handling. --- .../src/main/kotlin/com/beust/kobalt/maven/aether/Aether.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/aether/Aether.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/aether/Aether.kt index 84476e05..77aaa13b 100644 --- a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/aether/Aether.kt +++ b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/aether/Aether.kt @@ -94,7 +94,7 @@ class Aether(val localRepo: File) { val newArtifact = DefaultArtifact(artifact.groupId, artifact.artifactId, artifact.extension, resolved.highestVersion.toString()) val artifactResult = resolve(newArtifact) - if (artifactResult != null) { + if (artifactResult != null && artifactResult.size > 0) { return artifactResult[0] } else { throw KobaltException("Couldn't find latest artifact for $group:$artifactId")