JCLOUDS-1023: Fix DigitalOcean getImage() method

This commit is contained in:
Ignasi Barrera 2015-10-22 11:13:30 +02:00
parent 26210fe098
commit 6254526296
1 changed files with 1 additions and 1 deletions

View File

@ -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