Looly 4 years ago
parent
commit
49452c76d8
1 changed files with 1 additions and 1 deletions
  1. 1 1
      hutool-json/src/main/java/cn/hutool/json/JSONObject.java

+ 1 - 1
hutool-json/src/main/java/cn/hutool/json/JSONObject.java

@@ -652,7 +652,7 @@ public class JSONObject implements JSON, JSONGetter<String>, Map<String, Object>
 			return;
 		}
 
-		if(ArrayUtil.isArray(source)){
+		if(ArrayUtil.isArray(source) || source instanceof JSONArray){
 			// 不支持集合类型转换为JSONObject
 			throw new JSONException("Unsupported type [{}] to JSONObject!", source.getClass());
 		}