Skip to content

Commit

Permalink
Merge pull request #12666 from ashera96/master
Browse files Browse the repository at this point in the history
Fix NPE encountered during API Product export
  • Loading branch information
RakhithaRR authored Oct 15, 2024
2 parents c59caba + 5218aa2 commit a1aeee4
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,12 @@ public static void addThumbnailToArchive(String archivePath, Identifier identifi
String tenantDomain = RestApiCommonUtil.getLoggedInUserTenantDomain();
String localImagePath = archivePath + File.separator + ImportExportConstants.IMAGE_RESOURCE;
try {
ResourceFile thumbnailResource = apiProvider.getIcon(currentUuid, tenantDomain);
ResourceFile thumbnailResource;
if (currentUuid == null) {
thumbnailResource = apiProvider.getIcon(identifier.getUUID(), tenantDomain);
} else {
thumbnailResource = apiProvider.getIcon(currentUuid, tenantDomain);
}
if (thumbnailResource != null) {
String mediaType = thumbnailResource.getContentType();
String extension = ImportExportConstants.fileExtensionMapping.get(mediaType);
Expand Down

0 comments on commit a1aeee4

Please sign in to comment.