android: Make sure we actually have a tile when updating it
Not sure when this happens exactly, in particular because the reported stack traces look like this java.lang.NullPointerException: at org.strongswan.android.ui.VpnTileService.updateTile (VpnTileService.java:220) at org.strongswan.android.ui.VpnTileService.onStartListening (VpnTileService.java:97) at android.service.quicksettings.TileService$H.handleMessage (TileService.java:407) which violates the API documentation for getQsTile(), which states: This tile is only valid for updates between onStartListening() and onStopListening(). But apparently that's not always the case. There have been two reports of such a crash, both on Android 8.0 and on Xiaomi Mi 5/6 devices, so maybe it's a bug in that particular image.
This commit is contained in:
parent
4bd4750131
commit
9fb00bf89f
|
@ -204,6 +204,10 @@ public class VpnTileService extends TileService implements VpnStateService.VpnSt
|
|||
}
|
||||
|
||||
Tile tile = getQsTile();
|
||||
if (tile == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (error != VpnStateService.ErrorState.NO_ERROR)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue