Explorar el Código

charAt is throwing out of bounds, if empty string

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
tobiasKaminsky hace 6 años
padre
commit
b5f742f3ba
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      src/main/java/com/owncloud/android/utils/DisplayUtils.java

+ 1 - 1
src/main/java/com/owncloud/android/utils/DisplayUtils.java

@@ -252,7 +252,7 @@ public final class DisplayUtils {
 
         String urlNoDots = url;
         String dots = "";
-        while (urlNoDots.charAt(0) == '.') {
+        while (urlNoDots.length() > 0 && urlNoDots.charAt(0) == '.') {
             urlNoDots = url.substring(1);
             dots = dots + ".";
         }