[libbluray-devel] StrUtl.Join(): check for 0-sized array

hpi1 git at videolan.org
Mon Apr 3 14:23:19 CEST 2017


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Mon Apr  3 11:57:28 2017 +0300| [a65fb7c95f262f830652f78cce48e542ca15ab2a] | committer: hpi1

StrUtl.Join(): check for 0-sized array

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=a65fb7c95f262f830652f78cce48e542ca15ab2a
---

 src/libbluray/bdj/java/org/videolan/StrUtil.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libbluray/bdj/java/org/videolan/StrUtil.java b/src/libbluray/bdj/java/org/videolan/StrUtil.java
index f7f99b2..43b08ed 100644
--- a/src/libbluray/bdj/java/org/videolan/StrUtil.java
+++ b/src/libbluray/bdj/java/org/videolan/StrUtil.java
@@ -24,7 +24,7 @@ import java.util.ArrayList;
 public class StrUtil {
     public static String Join(String[] strings, String separator) {
         String result = "";
-        if (strings != null) {
+        if (strings != null && strings.length > 0) {
             result = strings[0];
             for (int i = 1; i < strings.length; i++) {
                 result = result + separator + strings[i];



More information about the libbluray-devel mailing list