iaun 5 năm trước cách đây
mục cha
commit
4cc1fbaac4
1 tập tin đã thay đổi với 12 bổ sung1 xóa
  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)
+	}
 }