]> source.dussan.org Git - poi.git/commitdiff
If given an empty (but not null) byte array to get a whole string from, return an...
authorNick Burch <nick@apache.org>
Wed, 10 May 2006 13:23:48 +0000 (13:23 +0000)
committerNick Burch <nick@apache.org>
Wed, 10 May 2006 13:23:48 +0000 (13:23 +0000)
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@405755 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/util/StringUtil.java

index 33a1a1328a16b7b731e6ae344ea695fcb5bf7619..70bbf044b8f798cf91b7aeff2c6d3d7a5548ce61 100644 (file)
@@ -88,6 +88,7 @@ public class StringUtil {
         *@return         the converted string    
         */
        public static String getFromUnicodeLE(final byte[] string) {
+               if(string.length == 0) { return ""; }
                return getFromUnicodeLE(string, 0, string.length / 2);
        }
 
@@ -140,6 +141,7 @@ public class StringUtil {
         *@return         the converted string     
         */
        public static String getFromUnicodeBE(final byte[] string) {
+               if(string.length == 0) { return ""; }
                return getFromUnicodeBE(string, 0, string.length / 2);
        }