Bluesky app fork with some witchin' additions 💫 witchsky.app
bluesky fork client

[React Native] Patch `RCTFileReaderModule` `readAsDataURL` to prevent crash when `type` is `nil` (#5475)

authored by hailey.at and committed by

GitHub 6338083a ea43d20c

+15 -2
+15 -2
patches/react-native+0.74.1.patch
··· 1 + diff --git a/node_modules/react-native/Libraries/Blob/RCTFileReaderModule.mm b/node_modules/react-native/Libraries/Blob/RCTFileReaderModule.mm 2 + index caa5540..6027825 100644 3 + --- a/node_modules/react-native/Libraries/Blob/RCTFileReaderModule.mm 4 + +++ b/node_modules/react-native/Libraries/Blob/RCTFileReaderModule.mm 5 + @@ -71,7 +71,7 @@ @implementation RCTFileReaderModule 6 + [NSString stringWithFormat:@"Unable to resolve data for blob: %@", [RCTConvert NSString:blob[@"blobId"]]], 7 + nil); 8 + } else { 9 + - NSString *type = [RCTConvert NSString:blob[@"type"]]; 10 + + NSString *type = RCTNilIfNull([RCTConvert NSString:blob[@"type"]]); 11 + NSString *text = [NSString stringWithFormat:@"data:%@;base64,%@", 12 + type != nil && [type length] > 0 ? type : @"application/octet-stream", 13 + [data base64EncodedStringWithOptions:0]]; 1 14 diff --git a/node_modules/react-native/Libraries/Text/TextInput/RCTBaseTextInputView.mm b/node_modules/react-native/Libraries/Text/TextInput/RCTBaseTextInputView.mm 2 - index b0d71dc..9974932 100644 15 + index b0d71dc..41b9a0e 100644 3 16 --- a/node_modules/react-native/Libraries/Text/TextInput/RCTBaseTextInputView.mm 4 17 +++ b/node_modules/react-native/Libraries/Text/TextInput/RCTBaseTextInputView.mm 5 18 @@ -377,10 +377,6 @@ - (void)textInputDidBeginEditing ··· 36 49 + 37 50 @end 38 51 diff --git a/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControl.m b/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControl.m 39 - index b09e653..4c32b31 100644 52 + index b09e653..f93cb46 100644 40 53 --- a/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControl.m 41 54 +++ b/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControl.m 42 55 @@ -198,9 +198,53 @@ - (void)refreshControlValueChanged