Ver código fonte

Fixed nil err in isempty record

worker-9 4 anos atrás
pai
commit
34b61f8e79
1 arquivos alterados com 3 adições e 0 exclusões
  1. 3 0
      database/statics.go

+ 3 - 0
database/statics.go

@@ -44,5 +44,8 @@ func PeersAreEqual(toCompare map[string]string, networkName string) bool {
 }
 
 func IsEmptyRecord(err error) bool {
+	if err == nil {
+		return false
+	}
 	return strings.Contains(err.Error(), NO_RECORD) || strings.Contains(err.Error(), NO_RECORDS)
 }