From 6254526296117616cc6c3aacc26167296b6c0277 Mon Sep 17 00:00:00 2001 From: Ignasi Barrera Date: Thu, 22 Oct 2015 11:13:30 +0200 Subject: [PATCH] JCLOUDS-1023: Fix DigitalOcean getImage() method --- .../compute/DigitalOcean2ComputeServiceAdapter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/providers/digitalocean2/src/main/java/org/jclouds/digitalocean2/compute/DigitalOcean2ComputeServiceAdapter.java b/providers/digitalocean2/src/main/java/org/jclouds/digitalocean2/compute/DigitalOcean2ComputeServiceAdapter.java index ec8dc1128b..f1f5919a9b 100644 --- a/providers/digitalocean2/src/main/java/org/jclouds/digitalocean2/compute/DigitalOcean2ComputeServiceAdapter.java +++ b/providers/digitalocean2/src/main/java/org/jclouds/digitalocean2/compute/DigitalOcean2ComputeServiceAdapter.java @@ -179,7 +179,7 @@ public class DigitalOcean2ComputeServiceAdapter implements ComputeServiceAdapter // provided. If it can be parsed as a number, use the method to get by ID. Otherwise, get by slug. Integer numericId = Ints.tryParse(imageId); Image image = numericId == null ? api.imageApi().get(imageId) : api.imageApi().get(numericId); - return ImageInRegion.create(image, region); + return image == null ? null : ImageInRegion.create(image, region); } @Override