Skip to content

Commit 6db89d7

Browse files
niuzhenguomastersingh24
authored andcommitted
[FAB-10170] Check mspMgrConfigDir is Dir
This tries to check whether mspMgrConfigDir is a Dir instead of just existing. Change-Id: Ifb9f52e7d88c5f2b74e4c47390bc71116f6db61e Signed-off-by: Zhenguo Niu <Niu.ZGlinux@gmail.com>
1 parent 71983e8 commit 6db89d7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

peer/common/common.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ func InitConfig(cmdRoot string) error {
100100
func InitCrypto(mspMgrConfigDir, localMSPID, localMSPType string) error {
101101
var err error
102102
// Check whether msp folder exists
103-
_, err = os.Stat(mspMgrConfigDir)
104-
if os.IsNotExist(err) {
103+
fi, err := os.Stat(mspMgrConfigDir)
104+
if os.IsNotExist(err) || !fi.IsDir() {
105105
// No need to try to load MSP from folder which is not available
106106
return errors.Errorf("cannot init crypto, missing %s folder", mspMgrConfigDir)
107107
}

0 commit comments

Comments
 (0)