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 <[email protected]>
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) {