From 1f9d155f0eb51eda4c5445436bbf7e79bcb15e86 Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Tue, 4 Aug 2020 18:23:15 -0500 Subject: [PATCH] Fix Panic in Wallet HasDir() (#6857) * fix panic in has dir * Merge refs/heads/master into has-dir-panic * Merge refs/heads/master into has-dir-panic * Merge refs/heads/master into has-dir-panic * Merge refs/heads/master into has-dir-panic * Merge refs/heads/master into has-dir-panic --- validator/accounts/v2/wallet.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/validator/accounts/v2/wallet.go b/validator/accounts/v2/wallet.go index 8fa67294a..f2b38aa3d 100644 --- a/validator/accounts/v2/wallet.go +++ b/validator/accounts/v2/wallet.go @@ -700,6 +700,9 @@ func hasDir(dirPath string) (bool, error) { if os.IsNotExist(err) { return false, nil } + if info == nil { + return false, nil + } return info.IsDir(), err }