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

Commit aebde718 authored by Thomas Stuart's avatar Thomas Stuart Committed by Android Build Coastguard Worker
Browse files

fix NPE in CallLog.AddCallParametersBuilder#setAssertedDisplayName

It appears some backup & restore CallLog tests are populating setAssertedDisplayName with
a null object. This is causing a NPE to occur.  This XS-CL fixes the NPE.

Fixes: 327754873
Test: existing CTS Coverage
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:30ef1129f8fe75b57f33b193cb9b9b64688263df)
Merged-In: Icebb86bfbecbf2bfce2ca118c5e8ffa21f2db392
Change-Id: Icebb86bfbecbf2bfce2ca118c5e8ffa21f2db392
parent 9f54dcf9
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -667,7 +667,8 @@ public class CallLog {
            @FlaggedApi(Flags.FLAG_BUSINESS_CALL_COMPOSER)
            public @NonNull AddCallParametersBuilder setAssertedDisplayName(
                    String assertedDisplayName) {
                if (assertedDisplayName.length() > MAX_NUMBER_OF_CHARACTERS) {
                if (assertedDisplayName != null
                        && assertedDisplayName.length() > MAX_NUMBER_OF_CHARACTERS) {
                    throw new IllegalArgumentException("assertedDisplayName exceeds the character"
                            + " limit of " + MAX_NUMBER_OF_CHARACTERS + ".");
                }