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

Commit 7746a94f authored by Jay Shrauner's avatar Jay Shrauner
Browse files

Fix NPE when have no phone accounts

Return empty List instead of null so calling functions don't throw NPE
when dereferencing return value.

Bug:17282683
Bug:17262485
Change-Id: Ica4952b11a8af28787a4a0b6a991ab888386aa7b
parent d68f83cc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -298,7 +298,7 @@ public final class RemoteConnection {
     * @return The children of this {@code RemoteConnection} if this {@code RemoteConnection} is
     * a conference, or an empty {@code List} otherwise.
     */
    public List<RemoteConnection> getChildren() { return null; }
    public List<RemoteConnection> getChildren() { return new ArrayList<>(); }

    /**
     * Obtains the state of this {@code RemoteConnection}.
+2 −1
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.util.Log;

import com.android.internal.telecomm.ITelecommService;

import java.util.ArrayList;
import java.util.List;

/**
@@ -298,7 +299,7 @@ public class TelecommManager {
        } catch (RemoteException e) {
            Log.e(TAG, "Error calling ITelecommService#getOutgoingPhoneAccounts", e);
        }
        return null;
        return new ArrayList<>();
    }

    /**