From b3f4e8480ed7146e0300117d6b2f9208c0a3b4e8 Mon Sep 17 00:00:00 2001 From: DavideViolante Date: Fri, 9 Aug 2024 18:23:37 +0200 Subject: [PATCH] fix: fix error argument is marked as nullable but React requires that all NSNumber arguments are nonnull --- ios/RNWifi.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ios/RNWifi.m b/ios/RNWifi.m index 98029c6..6c81673 100644 --- a/ios/RNWifi.m +++ b/ios/RNWifi.m @@ -63,7 +63,8 @@ + (BOOL)requiresMainQueueSetup RCT_EXPORT_METHOD(connectToSSID:(NSString*)ssid resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) { - [self connectToProtectedSSID:ssid withPassphrase:@"" isWEP:false isHidden:false timeout:nil resolver:resolve rejecter:reject]; + NSNumber *defaultTimeout = @(0); // Provide a default value for timeout, fix issue #379 + [self connectToProtectedSSID:ssid withPassphrase:@"" isWEP:false isHidden:false timeout:defaultTimeout resolver:resolve rejecter:reject]; } RCT_EXPORT_METHOD(connectToSSIDPrefix:(NSString*)ssid @@ -131,7 +132,7 @@ + (BOOL)requiresMainQueueSetup withPassphrase:(NSString*)passphrase isWEP:(BOOL)isWEP isHidden:(BOOL)isHidden - timeout:(nullable NSNumber *)timeout + timeout:(nonnull NSNumber *)timeout // Explicitly mark timeout as nonnull, fix issue #379 resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) { [self connectToProtectedSSIDOnce:ssid withPassphrase:passphrase isWEP:isWEP joinOnce:false resolver:resolve rejecter:reject];