From 5d2cf945f3002f2d9695183d1b17faff45470bdf Mon Sep 17 00:00:00 2001 From: WrBug Date: Thu, 15 Jan 2026 02:10:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20AccountOnChainMonit?= =?UTF-8?q?orService=20=E4=B8=AD=20JsonNull=20=E5=AF=BC=E8=87=B4=E7=9A=84?= =?UTF-8?q?=E5=B4=A9=E6=BA=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 增加 receiptRpcResponse.result.isJsonNull 检查 - 防止在链上查询返回 JsonNull 时调用 asJsonObject() 抛出 IllegalStateException - 优化空值处理逻辑,确保程序安全退出 --- .../copytrading/monitor/AccountOnChainMonitorService.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/main/kotlin/com/wrbug/polymarketbot/service/copytrading/monitor/AccountOnChainMonitorService.kt b/backend/src/main/kotlin/com/wrbug/polymarketbot/service/copytrading/monitor/AccountOnChainMonitorService.kt index 6209925..ec8b8a0 100644 --- a/backend/src/main/kotlin/com/wrbug/polymarketbot/service/copytrading/monitor/AccountOnChainMonitorService.kt +++ b/backend/src/main/kotlin/com/wrbug/polymarketbot/service/copytrading/monitor/AccountOnChainMonitorService.kt @@ -114,10 +114,10 @@ class AccountOnChainMonitorService( } val receiptRpcResponse = receiptResponse.body()!! - if (receiptRpcResponse.error != null || receiptRpcResponse.result == null) { + if (receiptRpcResponse.error != null || receiptRpcResponse.result == null || receiptRpcResponse.result.isJsonNull) { return } - + // 使用 Gson 解析 receipt JSON val receiptJson = receiptRpcResponse.result.asJsonObject