瀏覽代碼

data adapt

0xdcarns 3 年之前
父節點
當前提交
c748594c02
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      database/database.go

+ 2 - 1
database/database.go

@@ -139,7 +139,8 @@ func createTable(tableName string) error {
 // IsJSONString - checks if valid json
 func IsJSONString(value string) bool {
 	var jsonInt interface{}
-	return json.Unmarshal([]byte(value), &jsonInt) == nil
+	var nodeInt models.Node
+	return json.Unmarshal([]byte(value), &jsonInt) == nil || json.Unmarshal([]byte(value), &nodeInt) == nil
 }
 
 // Insert - inserts object into db