From 3b2743fc89bb9ea74f33752e33357a0b919ad06c Mon Sep 17 00:00:00 2001 From: yunfeiyangbuaa Date: Sat, 14 Sep 2019 13:47:17 +0800 Subject: [PATCH] fix dfget panic Signed-off-by: yunfeiyangbuaa --- dfget/core/core.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dfget/core/core.go b/dfget/core/core.go index a8d82ba03..b13742372 100644 --- a/dfget/core/core.go +++ b/dfget/core/core.go @@ -299,7 +299,7 @@ func reportMetrics(cfg *config.Config, supernodeAPI api.SupernodeAPI, downloadTi if err != nil { logrus.Errorf("failed to report metrics to supernode %s: %v", node, err) } - if resp.IsSuccess() { + if resp != nil && resp.IsSuccess() { return } }