From c545381152a22df29d16c063fd6cd2fab4ec7b33 Mon Sep 17 00:00:00 2001 From: Geoff Macartney Date: Tue, 6 Jun 2017 17:15:10 +0100 Subject: [PATCH] Check versionedName to avoid NPE. Fixes break from https://github.com/apache/brooklyn-server/pull/672, I merged without re-running unit tests :-( --- .../org/apache/brooklyn/rest/resources/CatalogResource.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/CatalogResource.java b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/CatalogResource.java index 2657c5431d..2d7487d481 100644 --- a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/CatalogResource.java +++ b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/CatalogResource.java @@ -171,7 +171,7 @@ public String getMessage() { public static BundleInstallationRestResult of(OsgiBundleInstallationResult in, ManagementContext mgmt, BrooklynRestResourceUtils brooklynU, UriInfo ui) { BundleInstallationRestResult result = new BundleInstallationRestResult(); result.message = in.getMessage(); - result.bundle = in.getMetadata().getVersionedName().toString(); + result.bundle = in.getVersionedName() != null ? in.getVersionedName().toString() : ""; result.code = in.getCode(); if (in.getCatalogItemsInstalled()!=null) { result.types = MutableMap.of();