From 138ba5c416d786d24f25508cd28f946b4a27e4b5 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 10 Jan 2018 00:41:28 +0100 Subject: 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 --- app/src/main/java/com/wireguard/android/QuickTileService.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app/src/main') 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. -- cgit v1.2.3