From 4cffc79d09de9ea3b13e43c3a9d1dcdfe196d7b1 Mon Sep 17 00:00:00 2001 From: Bas de Vaan Date: Fri, 31 May 2024 11:15:22 +0200 Subject: [PATCH] fix parsing thread response when map is empty --- lib/src/model/thread/response/thread_response.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/model/thread/response/thread_response.dart b/lib/src/model/thread/response/thread_response.dart index fbcea9b..bc5e985 100644 --- a/lib/src/model/thread/response/thread_response.dart +++ b/lib/src/model/thread/response/thread_response.dart @@ -18,7 +18,7 @@ class ThreadResponse { createdAt: json["created_at"] ?? 0, id: json["id"] ?? '', object: json["object"] ?? '', - toolResources: json['tool_resources']); + toolResources: json['tool_resources'] is Map ? json['tool_resources'] : null); Map toJson() => { "metadata": metadata,