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

Commit f0071532 authored by Tyler Gunn's avatar Tyler Gunn
Browse files

Fix potential NPE when creating an ImsCall.

If the call profile is null on ImsCall creation, the code to track the
video state history will crash.

Test: Add unit test for setting up a new ImsCall when profile is null.
Test: Add unit test for non-null ImsCall profile creation.
Fixes: 156188660
Change-Id: I2560cd32891977b7297a1dfaca7ca01381794ca0
parent 2a4164bf
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -3672,7 +3672,8 @@ public class ImsCall implements ICall {
     * @param profile The current {@link ImsCallProfile} for the call.
     */
    private void trackVideoStateHistory(ImsCallProfile profile) {
        mWasVideoCall = mWasVideoCall || profile.isVideoCall();
        mWasVideoCall = mWasVideoCall
                || profile != null ? profile.isVideoCall() : false;
    }

    /**
+1 −0
Original line number Diff line number Diff line
@@ -1985,6 +1985,7 @@ public class ImsManager implements IFeatureConnector {

            return call;
        } catch (Throwable t) {
            loge("takeCall caught: ", t);
            throw new ImsException("takeCall()", t, ImsReasonInfo.CODE_UNSPECIFIED);
        }
    }