diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-01-10 00:41:28 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-01-10 00:41:28 +0100 |
commit | 138ba5c416d786d24f25508cd28f946b4a27e4b5 (patch) | |
tree | be354e6e43f9b4269d07918dbd7ac64db340cc84 | |
parent | c6bdeb1d4579bd23365dcc575b12d8a15660f519 (diff) |
QuickTileService: sometimes tile is null
According to play store reports, such as:
wt88047, 0MB RAM, Android 8.1
java.lang.NullPointerException:
at com.wireguard.android.QuickTileService.updateTile (QuickTileService.java:97)
at com.wireguard.android.QuickTileService.onStartListening (QuickTileService.java:56)
at android.service.quicksettings.TileService$H.handleMessage (TileService.java:407)
at android.os.Handler.dispatchMessage (Handler.java:106)
at android.os.Looper.loop (Looper.java:164)
at android.app.ActivityThread.main (ActivityThread.java:6520)
at java.lang.reflect.Method.invoke (Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:442)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:807)
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r-- | app/src/main/java/com/wireguard/android/QuickTileService.java | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/src/main/java/com/wireguard/android/QuickTileService.java b/app/src/main/java/com/wireguard/android/QuickTileService.java index 20883a41..e694af4e 100644 --- a/app/src/main/java/com/wireguard/android/QuickTileService.java +++ b/app/src/main/java/com/wireguard/android/QuickTileService.java @@ -94,6 +94,8 @@ public class QuickTileService extends TileService { label = getString(R.string.app_name); state = Tile.STATE_INACTIVE; } + if (tile == null) + return; tile.setLabel(label); if (tile.getState() != state) { // The icon must be changed every time the state changes, or the shade will not change. |