Skip to content

Commit a93b9d7

Browse files
committed
chore: add more defensive checks for moduleConfig
1 parent b85639f commit a93b9d7

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/main/java/io/weaviate/client6/v1/api/collections/CollectionConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ public CollectionConfig read(JsonReader in) throws IOException {
289289

290290
// Separate modules into reranker- and generative- modules.
291291
var rerankerModules = new JsonArray();
292-
if (jsonObject.has("moduleConfig")) {
292+
if (jsonObject.has("moduleConfig") && jsonObject.get("moduleConfig").isJsonObject()) {
293293
var moduleConfig = jsonObject.remove("moduleConfig").getAsJsonObject();
294294

295295
moduleConfig.entrySet().stream()

src/test/java/io/weaviate/client6/v1/internal/json/JSONTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ public void test_ReferenceAddManyResponse_CustomDeserializer() {
400400
"result": { "status": "SUCCESS", "errors": {} }
401401
},
402402
{
403-
"result": { "status": "FAILED", "errors": jsonObject.has("properties") && {
403+
"result": { "status": "FAILED", "errors": {
404404
"error": [ "oops" ]
405405
}}
406406
}

0 commit comments

Comments
 (0)