File tree Expand file tree Collapse file tree 1 file changed +21
-19
lines changed
FirebaseAuth/Sources/AuthProvider/Phone Expand file tree Collapse file tree 1 file changed +21
-19
lines changed Original file line number Diff line number Diff line change @@ -263,26 +263,28 @@ - (nullable NSString *)reCAPTCHATokenForURL:(NSURL *)URL error:(NSError **_Nonnu
263
263
} else {
264
264
errorData = nil ;
265
265
}
266
- NSError *jsonError;
267
- NSDictionary *errorDict = [NSJSONSerialization JSONObjectWithData: errorData
268
- options: 0
269
- error: &jsonError];
270
- if (jsonError) {
271
- *error = [FIRAuthErrorUtils JSONSerializationErrorWithUnderlyingError: jsonError];
272
- return nil ;
273
- }
274
- *error = [FIRAuthErrorUtils URLResponseErrorWithCode: errorDict[@" code" ]
275
- message: errorDict[@" message" ]];
276
- if (!*error) {
277
- NSString *reason;
278
- if (errorDict[@" code" ] && errorDict[@" message" ]) {
279
- reason = [NSString stringWithFormat: @" [%@ ] - %@ " , errorDict[@" code" ], errorDict[@" message" ]];
280
- } else {
281
- reason = [NSString stringWithFormat: @" An unknown error occurred with the following "
282
- " response: %@ " ,
283
- deepLinkURL];
266
+ if (error != NULL ) {
267
+ NSError *jsonError;
268
+ NSDictionary *errorDict = [NSJSONSerialization JSONObjectWithData: errorData
269
+ options: 0
270
+ error: &jsonError];
271
+ if (jsonError) {
272
+ *error = [FIRAuthErrorUtils JSONSerializationErrorWithUnderlyingError: jsonError];
273
+ return nil ;
274
+ }
275
+ *error = [FIRAuthErrorUtils URLResponseErrorWithCode: errorDict[@" code" ]
276
+ message: errorDict[@" message" ]];
277
+ if (!*error) {
278
+ NSString *reason;
279
+ if (errorDict[@" code" ] && errorDict[@" message" ]) {
280
+ reason = [NSString stringWithFormat: @" [%@ ] - %@ " , errorDict[@" code" ], errorDict[@" message" ]];
281
+ } else {
282
+ reason = [NSString stringWithFormat: @" An unknown error occurred with the following "
283
+ " response: %@ " ,
284
+ deepLinkURL];
285
+ }
286
+ *error = [FIRAuthErrorUtils appVerificationUserInteractionFailureWithReason: reason];
284
287
}
285
- *error = [FIRAuthErrorUtils appVerificationUserInteractionFailureWithReason: reason];
286
288
}
287
289
return nil ;
288
290
}
You can’t perform that action at this time.
0 commit comments