-
Type: Bug
-
Status: Resolved
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: 10.10-HF54, 2021.12
-
Fix Version/s: 10.10-HF60, 2021.19
-
Component/s: Renditions, Rest API
-
Tags:
-
Sprint:nxplatform #59
-
Story Points:1
When trying to create a new document from Web UI, we can see in the logs the following warn:
2022-04-05T09:58:45,159 WARN [AbstractJsonEnricher] The following error occured with enricher: renditions
java.lang.NullPointerException: null
at org.nuxeo.ecm.core.api.UnrestrictedSessionRunner.checkUnrestricted(UnrestrictedSessionRunner.java:100) ~[nuxeo-core-api-2021.18-SNAPSHOT.jar:?]
at org.nuxeo.ecm.core.api.UnrestrictedSessionRunner.<init>(UnrestrictedSessionRunner.java:55) ~[nuxeo-core-api-2021.18-SNAPSHOT.jar:?]
at org.nuxeo.ecm.platform.rendition.service.RenditionFinder.<init>(RenditionFinder.java:66) ~[nuxeo-platform-rendition-core-2021.17.8.jar:?]
at org.nuxeo.ecm.platform.rendition.service.DefaultStoredRenditionManager.findStoredRendition(DefaultStoredRenditionManager.java:45) ~[nuxeo-platform-rendition-core-2021.17.8.jar:?]
at org.nuxeo.ecm.platform.rendition.service.RenditionServiceImpl.getRendition(RenditionServiceImpl.java:330) ~[nuxeo-platform-rendition-core-2021.17.8.jar:?]
at org.nuxeo.ecm.platform.rendition.service.RenditionServiceImpl.getRendition(RenditionServiceImpl.java:307) ~[nuxeo-platform-rendition-core-2021.17.8.jar:?]
at org.nuxeo.ecm.platform.rendition.service.RenditionServiceImpl.getAvailableRenditions(RenditionServiceImpl.java:396) ~[nuxeo-platform-rendition-core-2021.17.8.jar:?]
at org.nuxeo.ecm.platform.rendition.io.RenditionJsonEnricher.write(RenditionJsonEnricher.java:55) ~[nuxeo-platform-rendition-core-2021.17.8.jar:?]
at org.nuxeo.ecm.platform.rendition.io.RenditionJsonEnricher.write(RenditionJsonEnricher.java:41) ~[nuxeo-platform-rendition-core-2021.17.8.jar:?]
at org.nuxeo.ecm.core.io.marshallers.json.enrichers.AbstractJsonEnricher.write(AbstractJsonEnricher.java:70) [nuxeo-core-io-2021.17.8.jar:?]
at org.nuxeo.ecm.core.io.marshallers.json.enrichers.AbstractJsonEnricher.write(AbstractJsonEnricher.java:46) [nuxeo-core-io-2021.17.8.jar:?]
at org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter.write(AbstractJsonWriter.java:81) [nuxeo-core-io-2021.17.8.jar:?]
at org.nuxeo.ecm.core.io.marshallers.json.ExtensibleEntityJsonWriter.write(ExtensibleEntityJsonWriter.java:106) [nuxeo-core-io-2021.17.8.jar:?]
at org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter.write(AbstractJsonWriter.java:81) [nuxeo-core-io-2021.17.8.jar:?]
at org.nuxeo.ecm.webengine.jaxrs.coreiodelegate.PartialCoreIODelegate.writeTo(PartialCoreIODelegate.java:113) [nuxeo-webengine-jaxrs-2021.17.8
...
This commit was intended to fix the issue but
List<Rendition> renditions = renditionService.getAvailableRenditions(document, true);
should be done after checking the document exists