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

Commit f356189f authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "APM: Do not add null DeviceDescriptor to DeviceVector."

parents b44da94f 3e17f40a
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -227,6 +227,7 @@ void DeviceVector::add(const DeviceVector &devices)
{
    bool added = false;
    for (const auto& device : devices) {
        ALOG_ASSERT(device != nullptr, "Null pointer found when adding DeviceVector");
        if (indexOf(device) < 0 && SortedVector::add(device) >= 0) {
            added = true;
        }
@@ -238,6 +239,7 @@ void DeviceVector::add(const DeviceVector &devices)

ssize_t DeviceVector::add(const sp<DeviceDescriptor>& item)
{
    ALOG_ASSERT(item != nullptr, "Adding null pointer to DeviceVector");
    ssize_t ret = indexOf(item);

    if (ret < 0) {