Skip to content

Commit

Permalink
#18018 sometimes the binary is not able, in some part of the transfor…
Browse files Browse the repository at this point in the history
…mation or lifecycle of the contentlet, so need to check NPE (#18115)

(cherry picked from commit 4834155)
  • Loading branch information
jdotcms authored and dsilvam committed Mar 9, 2020
1 parent 86356dd commit 9cb2e09
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -5587,7 +5587,7 @@ public String getName(final Contentlet contentlet, final User user, final boolea
final String transientNameKey = DotAssetContentType.ASSET_FIELD_VAR + "name";
final String dotAssetName = contentlet.getStringProperty(transientNameKey);
String assetName = dotAssetName;
if (!UtilMethods.isSet(dotAssetName)) {
if (!UtilMethods.isSet(dotAssetName) && null != contentlet.getBinary(DotAssetContentType.ASSET_FIELD_VAR)) {
assetName = contentlet.getBinary(DotAssetContentType.ASSET_FIELD_VAR).getName();
contentlet.setStringProperty(transientNameKey, assetName);
}
Expand Down

0 comments on commit 9cb2e09

Please sign in to comment.