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 10:58:32 UTC
[sling-org-apache-sling-servlets-get] branch master updated:
SLING-10425: fix an NPE in JSON conversion (#8)
This is an automated email from the ASF dual-hosted git repository.
pauls pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-servlets-get.git
The following commit(s) were added to refs/heads/master by this push:
new f4b4690 SLING-10425: fix an NPE in JSON conversion (#8)
f4b4690 is described below
commit f4b4690f4491728be86d3a382a2fead95e5bf064
Author: Karl Pauls <pa...@apache.org>
AuthorDate: Thu May 27 12:58:23 2021 +0200
SLING-10425: fix an NPE in JSON conversion (#8)
---
.../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) {