From e5c1c45ed29d58c79cad5c1bd7b1eb9f09da22ed Mon Sep 17 00:00:00 2001 From: adriancole Date: Mon, 25 Mar 2013 08:28:54 -0700 Subject: [PATCH] it is possible that for access control reasons, templates in trmk can be null --- .../functions/ImageForVCloudExpressVAppTemplate.java | 2 ++ .../compute/functions/ImagesInVCloudExpressOrg.java | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/common/trmk/src/main/java/org/jclouds/trmk/vcloud_0_8/compute/functions/ImageForVCloudExpressVAppTemplate.java b/common/trmk/src/main/java/org/jclouds/trmk/vcloud_0_8/compute/functions/ImageForVCloudExpressVAppTemplate.java index 4a54d5ba57..dfd68d660d 100644 --- a/common/trmk/src/main/java/org/jclouds/trmk/vcloud_0_8/compute/functions/ImageForVCloudExpressVAppTemplate.java +++ b/common/trmk/src/main/java/org/jclouds/trmk/vcloud_0_8/compute/functions/ImageForVCloudExpressVAppTemplate.java @@ -61,6 +61,8 @@ public class ImageForVCloudExpressVAppTemplate implements Function apply(Org from) { Iterable catalogs = allCatalogItemsInOrg.apply(from); Iterable vAppTemplates = vAppTemplatesForCatalogItems.apply(catalogs); - return Iterables.transform(vAppTemplates, imageForVAppTemplateProvider.get().withParent(from)); + return FluentIterable.from(vAppTemplates) + .transform(imageForVAppTemplateProvider.get().withParent(from)) + .filter(notNull()); } }