0xdcarns hace 3 años
padre
commit
c748594c02
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  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