]> source.dussan.org Git - poi.git/commitdiff
Allow dumping of null arrays
authorNick Burch <nick@apache.org>
Mon, 13 Jul 2015 17:31:04 +0000 (17:31 +0000)
committerNick Burch <nick@apache.org>
Mon, 13 Jul 2015 17:31:04 +0000 (17:31 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1690772 13f79535-47bb-0310-9956-ffa450edef68

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

index 979ca1c9c5e62ed2dfd7e4ed867a88cb78fe2b73..d88a2fbaf03afea6e5a56007219a5dec29d373da 100644 (file)
@@ -253,12 +253,15 @@ public class HexDump {
     {
         StringBuffer retVal = new StringBuffer();
         retVal.append('[');
-        for(int x = 0; x < value.length; x++)
+        if (value != null && value.length > 0)
         {
-            if (x>0) {
-                retVal.append(", ");
+            for(int x = 0; x < value.length; x++)
+            {
+                if (x>0) {
+                    retVal.append(", ");
+                }
+                retVal.append(toHex(value[x]));
             }
-            retVal.append(toHex(value[x]));
         }
         retVal.append(']');
         return retVal.toString();