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

Commit 417e43d9 authored by Guillaume Bailey's avatar Guillaume Bailey
Browse files

Check for nullptr when creating offline camera descriptor

Test: atest -cv CtsCameraTestCases
Bug: 257005030
Change-Id: If292ac3d78b1d0118952983ecc3cf60ae0d87a7d
parent 861cba83
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2094,6 +2094,10 @@ status_t CameraService::addOfflineClient(String8 cameraId, sp<BasicClient> offli
                onlineClientDesc->getOwnerId(), onlinePriority.getState(),
                // native clients don't have offline processing support.
                /*ommScoreOffset*/ 0, /*systemNativeClient*/false);
        if (offlineClientDesc == nullptr) {
            ALOGE("%s: Offline client descriptor was NULL", __FUNCTION__);
            return BAD_VALUE;
        }

        // Allow only one offline device per camera
        auto incompatibleClients = mActiveClientManager.getIncompatibleClients(offlineClientDesc);