diff --git a/ios/Plugin/CodePush.m b/ios/Plugin/CodePush.m index 3a2c59bf..d27ad4fc 100644 --- a/ios/Plugin/CodePush.m +++ b/ios/Plugin/CodePush.m @@ -85,7 +85,11 @@ - (void)getPackageHash:(CAPPluginCall *)call { - (void)getPublicKey:(CAPPluginCall *)call { NSString *publicKey = [self getConfigValue:PublicKeyPreference]; - [call resolve:@{@"value":publicKey}]; + if (!publicKey) { + [call resolve:nil]; /* Returning @{@"value":nil} causes an uncaught exception */ + } else { + [call resolve:@{@"value":publicKey}]; + } } - (void)decodeSignature:(CAPPluginCall *)call {