fixes #2848 newnym might call a null conn in service

This commit is contained in:
Nathan Freitas 2014-01-09 15:29:51 -05:00
parent 069a9bf377
commit cf5e4454eb
1 changed files with 13 additions and 10 deletions

View File

@ -1387,17 +1387,20 @@ public class TorService extends Service implements TorServiceConstants, TorConst
public void newIdentity () public void newIdentity ()
{ {
//it is possible to not have a connection yet, and someone might try to newnym
new Thread () if (conn != null)
{ {
public void run () new Thread ()
{ {
try { conn.signal("NEWNYM"); } public void run ()
catch (IOException ioe){ {
logMessage("error requesting newny: " + ioe.getLocalizedMessage()); try { conn.signal("NEWNYM"); }
} catch (IOException ioe){
} logMessage("error requesting newny: " + ioe.getLocalizedMessage());
}.start(); }
}
}.start();
}
} }
public boolean saveConfiguration () public boolean saveConfiguration ()