From d8cb6d1ba30342f8b31b4c28fc906870068bd531 Mon Sep 17 00:00:00 2001
From: Gospodin Bodurov <gospodin@bodurov.net>
Date: Thu, 30 Aug 2018 10:18:56 +0300
Subject: [PATCH] Fix bug

---
 handler/utils.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/handler/utils.go b/handler/utils.go
index 7a2b0d1..a8e2ba9 100644
--- a/handler/utils.go
+++ b/handler/utils.go
@@ -38,7 +38,7 @@ func generateUnusedUUID(client *client.DataStorageClientImpl) (string, error) {
 		// check that uuid is not used
 		data, _ := client.DoGetDataCall("keys", uuid+"/"+api.KeyType.String(api.KeyType_PRIVATE))
 
-		if data.Errors != "" || err != nil {
+		if data == nil || data.Errors != "" || err != nil {
 			return uuid, nil
 		}
 		if count >= 10 {
-- 
GitLab