From 8b300f0d05ccb896e23cc4a06a0a6da1caa593e4 Mon Sep 17 00:00:00 2001 From: Gabriele M Date: Wed, 16 May 2018 17:44:21 +0200 Subject: [PATCH] Prevent null pointer exceptions The main activity connects to the service after setting up the local broadcast. This allows the service to send notification before the activity is ready, causing null pointer exceptions. This happens for example rotating the screen while an update is being installed. Also, replace the existing check on mUpdaterController with a check on mDownloadsId since the latter depends on the former and both are required. Change-Id: I620fd7aa1e90468ab40dfedaa06c23f96f3e6807 --- src/org/lineageos/updater/UpdatesListAdapter.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/org/lineageos/updater/UpdatesListAdapter.java b/src/org/lineageos/updater/UpdatesListAdapter.java index 957952a7..37b0f94f 100644 --- a/src/org/lineageos/updater/UpdatesListAdapter.java +++ b/src/org/lineageos/updater/UpdatesListAdapter.java @@ -204,7 +204,7 @@ public class UpdatesListAdapter extends RecyclerView.Adapter