From 56054e27dbb0464adf101aac0597ec3906a315ce Mon Sep 17 00:00:00 2001 From: Murali Date: Mon, 4 Sep 2017 05:51:44 +0000 Subject: Fix the null pointer exception Change-Id: I1ebc769db84dfe9fe53f4cc60576bb7f855b9d92 Jira:VNFSDK-34 Signed-off-by: Murali --- .../java/org/onap/vnfsdk/marketplace/wrapper/PackageWrapper.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'vnfmarket-be/vnf-sdk-marketplace/src/main') diff --git a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/wrapper/PackageWrapper.java b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/wrapper/PackageWrapper.java index b6fba66e..3bb383fd 100644 --- a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/wrapper/PackageWrapper.java +++ b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/wrapper/PackageWrapper.java @@ -201,9 +201,14 @@ public class PackageWrapper { return Response.status(Status.EXPECTATION_FAILED).build(); } - LOG.info("the fileDetail = " + ToolUtil.objectToString(fileDetail)); + String fileName = "temp_"+ packageId + ".csar"; + if (null != fileDetail) + { + LOG.info("the fileDetail = " + ToolUtil.objectToString(fileDetail)); - String fileName = ToolUtil.processFileName(fileDetail.getFileName()); + fileName = ToolUtil.processFileName(fileDetail.getFileName()); + } + String localDirName = ToolUtil.getTempDir(CommonConstant.CATALOG_CSAR_DIR_NAME, fileName); String contentRange = null; -- cgit 1.2.3-korg