From e51342c778a43b90b373a3c39044a0fa045495bc Mon Sep 17 00:00:00 2001 From: John Knox Date: Thu, 30 Aug 2018 04:24:15 -0700 Subject: [PATCH] Fix Nan / Inf serialization issue Summary: Sonar was trying to convert folly dynamics containing NaN and Inf to json. Folly doesn't allow this so we have to get rid of them before converting. See https://fb.facebook.com/groups/230455004101832/permalink/483173632163300/ for more context. `grep -r convertFollyDynamicToId fbsource/xplat/sonar` now returns results which all have `true` in the second parameter slot. Reviewed By: danielbuechele Differential Revision: D9570364 fbshipit-source-id: bf28b03e54b4987399e028a491d82451a8267d97 --- iOS/SonarKit/CppBridge/SonarCppBridgingResponder.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iOS/SonarKit/CppBridge/SonarCppBridgingResponder.mm b/iOS/SonarKit/CppBridge/SonarCppBridgingResponder.mm index 0b3714fb4..654b22116 100644 --- a/iOS/SonarKit/CppBridge/SonarCppBridgingResponder.mm +++ b/iOS/SonarKit/CppBridge/SonarCppBridgingResponder.mm @@ -28,8 +28,8 @@ #pragma mark - SonarResponder -- (void)success:(NSDictionary *)response { responder_->success(facebook::cxxutils::convertIdToFollyDynamic(response)); } +- (void)success:(NSDictionary *)response { responder_->success(facebook::cxxutils::convertIdToFollyDynamic(response, true)); } -- (void)error:(NSDictionary *)response { responder_->error(facebook::cxxutils::convertIdToFollyDynamic(response)); } +- (void)error:(NSDictionary *)response { responder_->error(facebook::cxxutils::convertIdToFollyDynamic(response, true)); } @end