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

Commit cca803cb authored by Chilun's avatar Chilun
Browse files

Add error handling for onConfigurationChanged

The new config may comes before mApplication is assigned. Add the error
handling to prevent the crash.

Bug: 211031909
Test: Launch app without crash
Change-Id: Iba5d1be0e6cb182b5f503f5aa827eb2967834d52
parent fd16e8c3
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1537,7 +1537,10 @@ public class Activity extends ContextThemeWrapper
    }

    private void dispatchActivityConfigurationChanged() {
        // In case the new config comes before mApplication is assigned.
        if (getApplication() != null) {
            getApplication().dispatchActivityConfigurationChanged(this);
        }
        Object[] callbacks = collectActivityLifecycleCallbacks();
        if (callbacks != null) {
            for (int i = 0; i < callbacks.length; i++) {