SLING-6346 - fixing null return for sling models adapting from SlingHttpServletRequest
authorJustin Edelson <justin@apache.org>
Wed, 30 Nov 2016 17:11:02 +0000 (17:11 +0000)
committerJustin Edelson <justin@apache.org>
Wed, 30 Nov 2016 17:11:02 +0000 (17:11 +0000)
This closes #187

git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1772087 13f79535-47bb-0310-9956-ffa450edef68

src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java

index 5fdf72c..b9385f4 100644 (file)
@@ -1161,9 +1161,7 @@ public class ModelAdapterFactory implements AdapterFactory, Runnable, ModelFacto
             throw new ModelClassException("Could find model registered for request path: " + request.getServletPath());
         }
         Result<?> result = internalCreateModel(request, clazz);
-        handleAndExportResult(result, name, targetClass, options);
-        // unreachable
-        return null;
+        return handleAndExportResult(result, name, targetClass, options);
     }
 
     private <T> T handleAndExportResult(Result<?> result, String name, Class<T> targetClass, Map<String, String> options) throws ExportException, MissingExporterException {