From 6532290397fd5eb661eefa1b8977e66640d23c7c Mon Sep 17 00:00:00 2001 From: Tadeu Zagallo Date: Tue, 3 Nov 2015 07:22:28 -0800 Subject: [PATCH] Guard against dev menu calling twice Summary: public The Dev Menu is for some reason eventually calling twice the callbacks, guard against it while we don't fix it. Reviewed By: nicklockwood Differential Revision: D2600470 fb-gh-sync-id: 50c622d2ab64ce50d51572dbfcc076c2765ce582 --- React/Profiler/RCTProfile.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/React/Profiler/RCTProfile.m b/React/Profiler/RCTProfile.m index 3032de741..c1e37e121 100644 --- a/React/Profiler/RCTProfile.m +++ b/React/Profiler/RCTProfile.m @@ -307,6 +307,10 @@ void RCTProfileInit(RCTBridge *bridge) NSString *RCTProfileEnd(RCTBridge *bridge) { + if (!RCTProfileIsProfiling()) { + return nil; + } + [[NSNotificationCenter defaultCenter] postNotificationName:RCTProfileDidEndProfiling object:nil];