File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -47,10 +47,16 @@ + (void)emitStoredEvent {
4747}
4848
4949+ (void )emitModuleTableUpdate : (NSDictionary *)moduleTable {
50+ if (![NSJSONSerialization isValidJSONObject: moduleTable]) {
51+ return ;
52+ }
53+ NSError *error = nil ;
5054 NSData *jsonData = [NSJSONSerialization dataWithJSONObject: moduleTable
5155 options: 0
52- error: nil ];
53- [self postNotificationName: kModuleTable withPayload: [[NSString alloc ] initWithData: jsonData encoding: NSUTF8StringEncoding]];
56+ error: &error];
57+ if (nil == error) {
58+ [self postNotificationName: kModuleTable withPayload: [[NSString alloc ] initWithData: jsonData encoding: NSUTF8StringEncoding]];
59+ }
5460}
5561
5662+ (void )postNotificationName : (NSString *)name withPayload : (NSObject *)object {
You can’t perform that action at this time.
0 commit comments