iaun hace 5 años
padre
commit
4cc1fbaac4
Se han modificado 1 ficheros con 12 adiciones y 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)
+	}
 }