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

Commit 11e515cb authored by Svetoslav Ganov's avatar Svetoslav Ganov
Browse files

NPE in in AppGlobals#getIntCoreSetting

bug:3508658

It ActivityThread#currentActivityThread() is called when
the ActivityThread is not attached it returns null and
AppGlobals#getIntCoreSetting was not checking for that.

Change-Id: I5e00d1947a161ad1e52ecfaa12cbbac3b534a0db
parent 6c8d7652
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -55,6 +55,11 @@ public class AppGlobals {
     * @return The core settings.
     */
    public static int getIntCoreSetting(String key, int defaultValue) {
        return ActivityThread.currentActivityThread().getIntCoreSetting(key, defaultValue);
        ActivityThread currentActivityThread = ActivityThread.currentActivityThread();
        if (currentActivityThread != null) {
            return currentActivityThread.getIntCoreSetting(key, defaultValue);
        } else {
            return defaultValue;
        }
    }
}