From 44b1b0963bd5597b2c85f05cbfae36221f28b0f4 Mon Sep 17 00:00:00 2001 From: Wilmer Paulino Date: Mon, 18 May 2020 15:59:43 -0700 Subject: [PATCH] aperture: check tor config nil-ness before access This prevents a panic on startup for instances running with configurations that don't specify any Tor options. --- aperture.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aperture.go b/aperture.go index 0eef867..a7a705e 100644 --- a/aperture.go +++ b/aperture.go @@ -160,7 +160,7 @@ func start() error { // will only be reached through the onion services, which already // provide encryption, so running this additional HTTP server should be // relatively safe. - if cfg.Tor.V2 || cfg.Tor.V3 { + if cfg.Tor != nil && (cfg.Tor.V2 || cfg.Tor.V3) { torController, err := initTorListener(cfg, etcdClient) if err != nil { return err