diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-07-19 20:52:28 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-07-19 20:57:00 +0200 |
commit | 60a6e29350d3e713e2a09931140c3ac1c9013664 (patch) | |
tree | c5a1e083e991e6fb96e0433255ce15de011aad5a /app/src/main/java/com/wireguard/android | |
parent | 3b0e0c2f163a751b62e6120b7ea0279d3e8f2269 (diff) |
QuickTileService: fix null pointer dereference
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'app/src/main/java/com/wireguard/android')
-rw-r--r-- | app/src/main/java/com/wireguard/android/QuickTileService.java | 6 |
1 files changed, 4 insertions, 2 deletions
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); |