iaun %!s(int64=5) %!d(string=hai) anos
pai
achega
4cc1fbaac4
Modificáronse 1 ficheiros con 12 adicións e 1 borrados
  1. 12 1
      timer.go

+ 12 - 1
timer.go

@@ -49,7 +49,12 @@ func timer_get() {
 		fmt.Printf("loadLog json error: %s\n", err)
 		return
 	}
-	logData = string(j)
+
+	if string(j) == "null" {
+		logData = "[]"
+	} else {
+		logData = string(j)
+	}
 
 	// select detail
 	rows, err = db.Query("call get_log_details()")
@@ -75,4 +80,10 @@ func timer_get() {
 		return
 	}
 	logDetail = string(j)
+
+	if string(j) == "null" {
+		logDetail = "[]"
+	} else {
+		logDetail = string(j)
+	}
 }