You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by pa...@apache.org on 2021/05/27 09:59:22 UTC

[sling-org-apache-sling-servlets-get] branch issues/SLING-10425 created (now c21e222)

This is an automated email from the ASF dual-hosted git repository.

pauls pushed a change to branch issues/SLING-10425
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-servlets-get.git.


      at c21e222  SLING-10425: fix an NPE in JSON conversion

This branch includes the following new commits:

     new c21e222  SLING-10425: fix an NPE in JSON conversion

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[sling-org-apache-sling-servlets-get] 01/01: SLING-10425: fix an NPE in JSON conversion

Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pauls pushed a commit to branch issues/SLING-10425
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-servlets-get.git

commit c21e22243072e97a428cb50bfe41f28b604e6eac
Author: Karl Pauls <ka...@gmail.com>
AuthorDate: Thu May 27 11:59:06 2021 +0200

    SLING-10425: fix an NPE in JSON conversion
---
 .../java/org/apache/sling/servlets/get/impl/util/JsonObjectCreator.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/servlets/get/impl/util/JsonObjectCreator.java b/src/main/java/org/apache/sling/servlets/get/impl/util/JsonObjectCreator.java
index 72dbb02..bdfaf02 100644
--- a/src/main/java/org/apache/sling/servlets/get/impl/util/JsonObjectCreator.java
+++ b/src/main/java/org/apache/sling/servlets/get/impl/util/JsonObjectCreator.java
@@ -242,7 +242,7 @@ public class JsonObjectCreator {
         } catch (IOException ignore) {
         }
         if (index == -1) {
-            return valueMap.get(key, Long.class);
+            return valueMap.get(key, index);
         }
         final Long[] lengths = valueMap.get(key, Long[].class);
         if (lengths != null && lengths.length > index) {