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:23 UTC
[sling-org-apache-sling-servlets-get] 01/01: SLING-10425: fix an
NPE in JSON conversion
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) {