kwin commented on a change in pull request #1:
URL:
https://github.com/apache/sling-org-apache-sling-scripting-sightly-models-provider/pull/1#discussion_r478933307
##########
File path:
src/main/java/org/apache/sling/scripting/sightly/models/impl/SlingModelsUseProvider.java
##########
@@ -124,8 +125,15 @@ public ProviderOutcome provide(final String identifier,
final RenderContext rend
// pass parameters as request attributes
Map<String, Object> overrides = setRequestAttributes(request,
arguments);
+ // Get adaptable from arguments
+ Object adaptableArgument = arguments.get(ADAPTABLE_KEY);
+
try {
- // try to instantiate class via Sling Models (first via request,
then via resource)
+ // try to instantiate class via Sling Models (in order: via
adaptableArgument, request, resource)
+ if (modelFactory.canCreateFromAdaptable(adaptableArgument, cls)) {
Review comment:
Please add a null check for adaptableArgument!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]