changed the way the version is fetched from nova to avoid NPE

This commit is contained in:
David Ribeiro Alves 2011-08-31 22:45:41 +01:00
parent 073eba9699
commit 8de88410f6
1 changed files with 1 additions and 1 deletions

View File

@ -46,7 +46,7 @@ public class NovaImageToImage implements Function<org.jclouds.openstack.nova.dom
builder.ids(from.getId() + ""); builder.ids(from.getId() + "");
builder.name(from.getName() != null ? from.getName() : "unspecified"); builder.name(from.getName() != null ? from.getName() : "unspecified");
builder.description(from.getName() != null ? from.getName() : "unspecified"); builder.description(from.getName() != null ? from.getName() : "unspecified");
builder.version(from.getUpdated().getTime() + ""); builder.version(from.getUpdated() != null ? from.getUpdated().getTime() + "" : "-1");
builder.operatingSystem(imageToOs.apply(from)); //image name may not represent the OS type builder.operatingSystem(imageToOs.apply(from)); //image name may not represent the OS type
builder.defaultCredentials(new Credentials("root", null)); builder.defaultCredentials(new Credentials("root", null));
builder.uri(from.getURI()); builder.uri(from.getURI());