From 13d439ace2d644259ac05a2e106f1b698e25059d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=88=B4=E9=BB=8E=E6=98=8E?= Date: Thu, 16 Apr 2020 15:37:08 +0800 Subject: [PATCH] fix up crash when record timeout +Inf --- .../Monitor/HawkeyeCore/MTHNetworkRecordsStorage.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MTHawkeye/NetworkPlugins/Monitor/HawkeyeCore/MTHNetworkRecordsStorage.m b/MTHawkeye/NetworkPlugins/Monitor/HawkeyeCore/MTHNetworkRecordsStorage.m index 24862b2..f0b5c14 100644 --- a/MTHawkeye/NetworkPlugins/Monitor/HawkeyeCore/MTHNetworkRecordsStorage.m +++ b/MTHawkeye/NetworkPlugins/Monitor/HawkeyeCore/MTHNetworkRecordsStorage.m @@ -62,7 +62,7 @@ - (MTAppenderFile *)networkRecordsFile { - (void)storeNetworkTransaction:(MTHNetworkTransaction *)transaction { NSDictionary *dict = [transaction dictionaryFromAllProperty]; - if ([dict count] == 0) { + if ([dict count] == 0 || ![NSJSONSerialization isValidJSONObject:dict]) { return; }