From 3ae37b29bde242c5bf87deb33b3a6dedd45b8b41 Mon Sep 17 00:00:00 2001 From: Matt Bell Date: Thu, 11 Sep 2014 17:50:05 -0700 Subject: [PATCH] core: Show error when config identity is not set --- core/core.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/core.go b/core/core.go index beb6ddd5a..0a9db055a 100644 --- a/core/core.go +++ b/core/core.go @@ -118,6 +118,10 @@ func NewIpfsNode(cfg *config.Config, online bool) (*IpfsNode, error) { } func initIdentity(cfg *config.Config) (*peer.Peer, error) { + if cfg.Identity == nil { + return nil, errors.New("Identity was not set in config (was ipfs init run?)") + } + if len(cfg.Identity.PeerID) == 0 { return nil, errors.New("No peer ID in config! (was ipfs init run?)") }