From cc57761da91c6e8814156c2e1f3110b2bd8b0910 Mon Sep 17 00:00:00 2001 From: CloudWebRTC Date: Fri, 21 May 2021 20:37:06 +0800 Subject: [PATCH] Fix crash when appName is not set. --- ios/Classes/CallKeep.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ios/Classes/CallKeep.m b/ios/Classes/CallKeep.m index 681a52c..498e3d7 100644 --- a/ios/Classes/CallKeep.m +++ b/ios/Classes/CallKeep.m @@ -580,7 +580,11 @@ + (CXProviderConfiguration *)getProviderConfiguration:(NSDictionary*)settings #ifdef DEBUG NSLog(@"[CallKeep][getProviderConfiguration]"); #endif - CXProviderConfiguration *providerConfiguration = [[CXProviderConfiguration alloc] initWithLocalizedName:settings[@"appName"]]; + NSString *appName = @"Unknown App"; + if (settings != nil) { + appName = settings[@"appName"]; + } + CXProviderConfiguration *providerConfiguration = [[CXProviderConfiguration alloc] initWithLocalizedName:appName]; providerConfiguration.supportsVideo = YES; providerConfiguration.maximumCallGroups = 3; providerConfiguration.maximumCallsPerCallGroup = 1;