@cryptotaxi247 / kubo / commits / 3ae37b29b

core: Show error when config identity is not set

Matt Bell committed Sep 11, 2014 at 17:50 UTC 3ae37b29bde242c5bf87deb33b3a6dedd45b8b41
1 file changed +4
core/core.go
+4
@@ -118,6 +118,10 @@ func NewIpfsNode(cfg *config.Config, online bool) (*IpfsNode, error) {
118 }
119
120 func initIdentity(cfg *config.Config) (*peer.Peer, error) {
121 + if cfg.Identity == nil {
122 + return nil, errors.New("Identity was not set in config (was ipfs init run?)")
123 + }
124 +
125 if len(cfg.Identity.PeerID) == 0 {
126 return nil, errors.New("No peer ID in config! (was ipfs init run?)")
127 }