From d78488a200ec1b42488ca92759ea69e8fd0686e2 Mon Sep 17 00:00:00 2001 From: Dan Ballard Date: Tue, 5 Feb 2019 11:54:52 -0800 Subject: [PATCH] torprovide more nil checks --- connectivity/torProvider.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/connectivity/torProvider.go b/connectivity/torProvider.go index 85e26c8..e8e06b5 100644 --- a/connectivity/torProvider.go +++ b/connectivity/torProvider.go @@ -63,6 +63,9 @@ func (ols *onionListenService) Close() { // GetBootstrapStatus returns an int 0-100 on the percent the bootstrapping of the underlying network is at and an optional string message func (tp *torProvider) GetBootstrapStatus() (int, string) { + if tp.t == nil { + return 0, "error: no tor, trying to restart..." + } kvs, err := tp.t.Control.GetInfo("status/bootstrap-phase") if err != nil { return 0, "error"