Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9e50d154 authored by Chienyuan's avatar Chienyuan
Browse files

OPP: Check uri string before parse it

Bug: 161499669
Tag: #refactor
Test: send/receive file via OPP
Change-Id: Ic98e84178dc8701bf9a72ece57677fe7999a01d4
parent 30b0b169
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -847,8 +847,10 @@ public class BluetoothOppService extends ProfileService implements IObexConnecti

        info.mId = cursor.getInt(cursor.getColumnIndexOrThrow(BluetoothShare._ID));
        if (info.mUri != null) {
            info.mUri =
                    Uri.parse(stringFromCursor(info.mUri.toString(), cursor, BluetoothShare.URI));
            String uriString = stringFromCursor(info.mUri.toString(), cursor, BluetoothShare.URI);
            if (uriString != null) {
                info.mUri = Uri.parse(uriString);
            }
        } else {
            Log.w(TAG, "updateShare() called for ID " + info.mId + " with null URI");
        }