diff options
author | Hailey <me@haileyok.com> | 2024-09-24 13:25:05 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-24 13:25:05 -0700 |
commit | 6338083a73847a08dcbcfaa9497f5771448dd9e1 (patch) | |
tree | 1de614ee3acb54770ad059aa5fe70dd5d499c795 /patches | |
parent | ea43d20c61547523e34ae864ca4ddffdedd8dfb1 (diff) | |
download | voidsky-6338083a73847a08dcbcfaa9497f5771448dd9e1.tar.zst |
[React Native] Patch `RCTFileReaderModule` `readAsDataURL` to prevent crash when `type` is `nil` (#5475)
Diffstat (limited to 'patches')
-rw-r--r-- | patches/react-native+0.74.1.patch | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/patches/react-native+0.74.1.patch b/patches/react-native+0.74.1.patch index 789ba84ac..c91e88c3e 100644 --- a/patches/react-native+0.74.1.patch +++ b/patches/react-native+0.74.1.patch @@ -1,5 +1,18 @@ +diff --git a/node_modules/react-native/Libraries/Blob/RCTFileReaderModule.mm b/node_modules/react-native/Libraries/Blob/RCTFileReaderModule.mm +index caa5540..6027825 100644 +--- a/node_modules/react-native/Libraries/Blob/RCTFileReaderModule.mm ++++ b/node_modules/react-native/Libraries/Blob/RCTFileReaderModule.mm +@@ -71,7 +71,7 @@ @implementation RCTFileReaderModule + [NSString stringWithFormat:@"Unable to resolve data for blob: %@", [RCTConvert NSString:blob[@"blobId"]]], + nil); + } else { +- NSString *type = [RCTConvert NSString:blob[@"type"]]; ++ NSString *type = RCTNilIfNull([RCTConvert NSString:blob[@"type"]]); + NSString *text = [NSString stringWithFormat:@"data:%@;base64,%@", + type != nil && [type length] > 0 ? type : @"application/octet-stream", + [data base64EncodedStringWithOptions:0]]; diff --git a/node_modules/react-native/Libraries/Text/TextInput/RCTBaseTextInputView.mm b/node_modules/react-native/Libraries/Text/TextInput/RCTBaseTextInputView.mm -index b0d71dc..9974932 100644 +index b0d71dc..41b9a0e 100644 --- a/node_modules/react-native/Libraries/Text/TextInput/RCTBaseTextInputView.mm +++ b/node_modules/react-native/Libraries/Text/TextInput/RCTBaseTextInputView.mm @@ -377,10 +377,6 @@ - (void)textInputDidBeginEditing @@ -36,7 +49,7 @@ index e9b330f..1ecdf0a 100644 + @end diff --git a/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControl.m b/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControl.m -index b09e653..4c32b31 100644 +index b09e653..f93cb46 100644 --- a/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControl.m +++ b/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControl.m @@ -198,9 +198,53 @@ - (void)refreshControlValueChanged |