Explorar o código

Fixed nil err in isempty record

worker-9 %!s(int64=4) %!d(string=hai) anos
pai
achega
34b61f8e79
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  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)
 }