From d93c71b61f62f7c10334de42e09a962046958a45 Mon Sep 17 00:00:00 2001 From: xenolf Date: Fri, 22 Apr 2016 01:53:50 +0200 Subject: [PATCH] Loading an account from file should fail if a integral part is nil. Fixes #191 --- account.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/account.go b/account.go index 85ac09f1..8b7798a0 100644 --- a/account.go +++ b/account.go @@ -64,6 +64,14 @@ func NewAccount(email string, conf *Configuration) *Account { acc.key = privKey acc.conf = conf + if acc.Registration == nil { + logger().Fatalf("Could not load account for %s. Registration is nil.", email) + } + + if acc.conf == nil { + logger().Fatalf("Could not load account for %s. Configuration is nil.", email) + } + return &acc }