Skip to content

Commit

Permalink
fix: [MOB-4845] Crashlytics: [__NSArray0 objectAtIndex:]: index 0 bey…
Browse files Browse the repository at this point in the history
…ond bounds for empty NSArray
  • Loading branch information
rcidt committed Aug 29, 2022
1 parent a51cb74 commit 1b994c0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ios/RNCallKeep/RNCallKeep.m
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,12 @@ + (void)initCallKitProvider {
}

+ (NSString *) getAudioOutput {
return [AVAudioSession sharedInstance].currentRoute.outputs.count > 0 ? [AVAudioSession sharedInstance].currentRoute.outputs[0].portType : nil;
@try{
return [AVAudioSession sharedInstance].currentRoute.outputs.count > 0 ? [AVAudioSession sharedInstance].currentRoute.outputs[0].portType : nil;
}@catch ( NSRangeException *e ){
NSLog(@"[RNCallKeep][getAudioOutput] exception: %@",e);
return nil;
}
}

+ (void)setup:(NSDictionary *)options {
Expand Down

0 comments on commit 1b994c0

Please sign in to comment.