fix leftovers after [#4051] PR (app crashes on iOS)

This commit is contained in:
Roman Volosovskyi 2018-05-09 18:23:49 +03:00
parent fc72443754
commit 90a508b64f
No known key found for this signature in database
GPG Key ID: 0238A4B5ECEE70DE
1 changed files with 8 additions and 18 deletions

View File

@ -85,16 +85,11 @@ RCT_EXPORT_METHOD(parseJail:(NSString *)chatId
NSLog(@"ParseJail() method called");
#endif
NSString *stringResult;
if([Status JSCEnabled]){
if(_jail == nil) {
_jail = [Jail new];
}
NSDictionary *result = [_jail parseJail:chatId withCode:js];
stringResult = [result bv_jsonStringWithPrettyPrint:NO];
} else {
char * result = Parse((char *) [chatId UTF8String], (char *) [js UTF8String]);
stringResult = [NSString stringWithUTF8String: result];
if(_jail == nil) {
_jail = [Jail new];
}
NSDictionary *result = [_jail parseJail:chatId withCode:js];
stringResult = [result bv_jsonStringWithPrettyPrint:NO];
callback(@[stringResult]);
}
@ -110,16 +105,11 @@ RCT_EXPORT_METHOD(callJail:(NSString *)chatId
dispatch_async( dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
NSString *stringResult;
if([Status JSCEnabled]){
if(_jail == nil) {
_jail = [Jail new];
}
NSDictionary *result = [_jail call:chatId path:path params:params];
stringResult = [result bv_jsonStringWithPrettyPrint:NO];
} else {
char * result = Call((char *) [chatId UTF8String], (char *) [path UTF8String], (char *) [params UTF8String]);
stringResult = [NSString stringWithUTF8String: result];
if(_jail == nil) {
_jail = [Jail new];
}
NSDictionary *result = [_jail call:chatId path:path params:params];
stringResult = [result bv_jsonStringWithPrettyPrint:NO];
dispatch_async( dispatch_get_main_queue(), ^{
callback(@[stringResult]);