René Grob created SLING-10137:
---------------------------------

             Summary: SlingModelAdapterFactory.createModel() returns null
                 Key: SLING-10137
                 URL: https://issues.apache.org/jira/browse/SLING-10137
             Project: Sling
          Issue Type: Bug
          Components: Sling Models
    Affects Versions: Models Implementation 1.4.16
            Reporter: René Grob


According to the documentation 
([https://sling.apache.org/documentation/bundles/models.html#modelfactory-since-120])
 null checks are not necessary. However if a {{@PostConstruct}} method returns 
false, 
{{org.apache.sling.models.impl.ModelAdapterFactory.invokePostConstruct()}} will 
return {{null}}. This will cause 
{{org.apache.sling.models.impl.ModelAdapterFactory.createModel()}} to fail 
because {{result.getThrowable()}} returns {{null}} which will result in {{throw 
null}}.

In order to fix this {{internalCreateModel()}} needs to return a valid 
throwable to indicate that the {{@PostConstruct}} method returned {{false}} and 
therefore no model was created.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to