From 8d95d0a13a278c4bd4dbffb682acf1e457dfb94b Mon Sep 17 00:00:00 2001
From: Tao Liejun <L.J.Tao@motorola.com>
Date: Wed, 15 Jul 2009 17:56:32 -0700
Subject: [PATCH] Fix a bug introduced in obex cleanup

Avoid exception when an empty array is passed to convert to Unicode
Before cleanup, there used to be an empty try/catch
---
 obex/javax/obex/ObexHelper.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/obex/javax/obex/ObexHelper.java b/obex/javax/obex/ObexHelper.java
index e6ade7b58d16..f5695954f000 100644
--- a/obex/javax/obex/ObexHelper.java
+++ b/obex/javax/obex/ObexHelper.java
@@ -875,7 +875,7 @@ public final class ObexHelper {
      * @throws IllegalArgumentException if the byte array has an odd length
      */
     public static String convertToUnicode(byte[] b, boolean includesNull) {
-        if (b == null) {
+        if (b == null || b.length == 0) {
             return null;
         }
         int arrayLength = b.length;
-- 
GitLab