Fix NullPointerException with external tor usage

If torControlPort is specified, but neither torControlPassword nor
torControlCookieFile are specified, we have cookieFile == null in
bisq.network.p2p.network.RunningTor, but RunningTor.getTor() assumes a
cookie file has been specified and tries to check that the file exists,
causing the thread to crash. Added a check for null to fix this.
This commit is contained in:
Daniel Dawson 2020-07-09 09:25:38 -07:00
parent 716947a799
commit 8c526d4b8c
No known key found for this signature in database
GPG Key ID: D572B791F7B4422A

View File

@ -64,7 +64,7 @@ public class RunningTor extends TorMode {
Tor result;
if (!password.isEmpty())
result = new ExternalTor(controlPort, password);
else if (cookieFile.exists())
else if (cookieFile != null && cookieFile.exists())
result = new ExternalTor(controlPort, cookieFile, useSafeCookieAuthentication);
else
result = new ExternalTor(controlPort);