From 2afb1183245eff5a381c660bc455f6ca868d9f55 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Thu, 19 Jul 2018 20:52:28 +0200 Subject: QuickTileService: fix null pointer dereference --- app/src/main/java/com/wireguard/android/QuickTileService.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'app/src/main/java/com') diff --git a/app/src/main/java/com/wireguard/android/QuickTileService.java b/app/src/main/java/com/wireguard/android/QuickTileService.java index fba8f57e..9e0790b6 100644 --- a/app/src/main/java/com/wireguard/android/QuickTileService.java +++ b/app/src/main/java/com/wireguard/android/QuickTileService.java @@ -72,8 +72,10 @@ public class QuickTileService extends TileService { public void onClick() { if (tunnel != null) { final Tile tile = getQsTile(); - tile.setIcon(tile.getIcon() == iconOn ? iconOff : iconOn); - tile.updateTile(); + if (tile != null) { + tile.setIcon(tile.getIcon() == iconOn ? iconOff : iconOn); + tile.updateTile(); + } tunnel.setState(State.TOGGLE).whenComplete(this::onToggleFinished); } else { final Intent intent = new Intent(this, MainActivity.class); -- cgit v1.2.3