fix NPE for when mHandler is null

This commit is contained in:
Nathan Freitas 2015-02-04 16:28:40 -05:00
parent 6832363905
commit 9b4ef18b13
1 changed files with 2 additions and 1 deletions

View File

@ -81,7 +81,8 @@ public class OrbotVpnService extends VpnService implements Handler.Callback {
else if (action.equals("stop"))
{
stopVPN();
mHandler.postDelayed(new Runnable () { public void run () { stopSelf(); }}, 1000);
if (mHandler != null)
mHandler.postDelayed(new Runnable () { public void run () { stopSelf(); }}, 1000);
}