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

Commit 3d700489 authored by Jorge Ruesga's avatar Jorge Ruesga
Browse files

CMFileManager: Fix NPE while retrieving background console

If the background console is null, then force allocation. Protect from NPE.

Change-Id: I57da98a9c18516f2f2936710387762dfc59543ff
parent 9fe2cd7b
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -224,7 +224,10 @@ public final class FileManagerApplication extends Application {
     * @return Console The background console
     */
    public static Console getBackgroundConsole() {
        if (!sBackgroundConsole.getConsole().isActive()) {
        if (sBackgroundConsole == null ||
            sBackgroundConsole.getConsole() == null ||
            !sBackgroundConsole.getConsole().isActive()) {

            allocBackgroundConsole(getInstance().getApplicationContext());
        }
        return sBackgroundConsole.getConsole();