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

Commit 1382c248 authored by Jonathan Klee's avatar Jonathan Klee
Browse files

fix: Prevent a NPE

Both noAccountView() and onAccountAvailable() methods can return
early, ending up in a RemoteViews not instanciated.
parent a68509a9
Loading
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -128,8 +128,11 @@ public class EDriveWidget extends AppWidgetProvider {
        } else {
            onAccountAvailable(context, accountManager);
        }

        if (views != null) {
            appWidgetManager.updateAppWidget(appWidgetId, views);
        }
    }

    private boolean isAccountPresentInApp(@NonNull Context context) {
        final SharedPreferences preferences = context.getApplicationContext().getSharedPreferences(AppConstants.SHARED_PREFERENCE_NAME, Context.MODE_PRIVATE);