Add null check in FKUserDefaultsSwizzleUtility.m (#1401)

Summary:
Prevent Flipper from runtime exception by add null c.heck

Pull Request resolved: https://github.com/facebook/flipper/pull/1401

Reviewed By: priteshrnandgaonkar

Differential Revision: D22789514

Pulled By: passy

fbshipit-source-id: 21a27298c8b662bbaeab13114ab7a0d310391ba3
This commit is contained in:
Michael Bahl
2020-07-28 06:53:50 -07:00
committed by Facebook GitHub Bot
parent e466bc4aed
commit 9c693b12c3

View File

@@ -59,7 +59,9 @@
NSString* originalStr = NSString* originalStr =
[@"comfacebookFlipperKit_" stringByAppendingString:selStr]; [@"comfacebookFlipperKit_" stringByAppendingString:selStr];
[invocation setSelector:NSSelectorFromString(originalStr)]; [invocation setSelector:NSSelectorFromString(originalStr)];
if (block != nil) {
block(invocation); block(invocation);
}
} else { } else {
((void (*)(id, SEL, NSInvocation*))orig)(this, fwdSel, invocation); ((void (*)(id, SEL, NSInvocation*))orig)(this, fwdSel, invocation);
} }