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

pauls pushed a commit to branch SLING-7499
in repository 
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-resourceresolver.git


The following commit(s) were added to refs/heads/SLING-7499 by this push:
     new e98f9e1  SLING-7499: handle blank string.
e98f9e1 is described below

commit e98f9e1504bf642310dbcba3580221594657a19f
Author: Karl Pauls <karlpa...@gmail.com>
AuthorDate: Wed Feb 14 16:15:28 2018 +0100

    SLING-7499: handle blank string.
---
 .../org/apache/sling/resourceresolver/impl/helper/URI.java     | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git 
a/src/main/java/org/apache/sling/resourceresolver/impl/helper/URI.java 
b/src/main/java/org/apache/sling/resourceresolver/impl/helper/URI.java
index 2da65cb..ec1caae 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/helper/URI.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/helper/URI.java
@@ -2029,8 +2029,14 @@ public class URI implements Cloneable, Comparable<URI>, 
Serializable {
                 idx++;
             }
             if (idx > 0) {
-                tmp = tmp.substring(idx);
-                length -= idx;
+                if (idx < length) {
+                    tmp = tmp.substring(idx);
+                    length -= idx;
+                }
+                else {
+                    tmp = "";
+                    length = 0;
+                }
             }
         }
 

-- 
To stop receiving notification emails like this one, please contact
pa...@apache.org.

Reply via email to