*** The wcm.io Project is closing down this JIRA Instance in favor of GitHub issues. *** Please use the corresponding GitHub projects to report issues - or the mailing list for general discussion.

MockAsset.removeRendition can throw NPE

Description

In MockAsset.removeRendition a NPE can occur if a non-existing rendition is removed, see (1). In that case rendition is null and thus a NPE is thrown at line 226.

(1) https://github.com/wcm-io/wcm-io-testing/blob/319bea35d3a7bcb253012b23044f987053f79ec3/aem-mock/core/src/main/java/io/wcm/testing/mock/aem/dam/MockAsset.java#L211

Activity

Show:

Stefan Seifert December 13, 2019 at 7:45 AM

last release was 2.7.0 - i plan to release 2.7.2 early next week

Jörg Hoh December 13, 2019 at 7:36 AM

Thanks Stefan!

When is the next version of AEM Mocks going to be released? I see the fixedVersion is set to 2.7.2 which is already released slightly smiling face

Stefan Seifert December 12, 2019 at 9:32 PM

ah, i see there is a difference between the Granite Asset impl and the CQ Asset impl - although the latter wraps only the former in case of removeRendition, it swallows (and logs) the exception of the former in case no rendition exists. so you're right, the method should not complain in this case.
https://helpx.adobe.com/experience-manager/6-3/sites/developing/using/reference-materials/javadoc/com/adobe/granite/asset/api/Asset.html#removeRendition(java.lang.String)

fixed in https://github.com/wcm-io/wcm-io-testing/commit/c2ff7988789c415375e70b3ee789b0c8dfbd1708

Jörg Hoh December 12, 2019 at 11:10 AM

Stefan Seifert December 9, 2019 at 10:02 AM

should be - when rendition is null the method is exited with exceptions a few lines above (same behavior as the original AEM implementation)

Fixed

Details

Assignee

Reporter

Components

Fix versions

Priority

Created December 6, 2019 at 11:29 AM
Updated January 31, 2020 at 10:36 PM
Resolved December 6, 2019 at 1:54 PM