fix: crash when fast-image fails to load an image
There is some weird behaviour in react-native-fast-image which causes it to crash whenever the onError or onLoadEnd prop is set. The issue is documented in https://github.com/DylanVann/react-native-fast-image/issues/504.
This commit is contained in:
22
patches/react-native-fast-image+8.6.3.patch
Normal file
22
patches/react-native-fast-image+8.6.3.patch
Normal file
@@ -0,0 +1,22 @@
|
||||
diff --git a/node_modules/react-native-fast-image/ios/FastImage/FFFastImageView.m b/node_modules/react-native-fast-image/ios/FastImage/FFFastImageView.m
|
||||
index f710081..87c4532 100644
|
||||
--- a/node_modules/react-native-fast-image/ios/FastImage/FFFastImageView.m
|
||||
+++ b/node_modules/react-native-fast-image/ios/FastImage/FFFastImageView.m
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
- (void) setOnFastImageLoadEnd: (RCTDirectEventBlock)onFastImageLoadEnd {
|
||||
_onFastImageLoadEnd = onFastImageLoadEnd;
|
||||
- if (self.hasCompleted) {
|
||||
+ if (self.hasCompleted && _onFastImageLoadEnd != NULL) {
|
||||
_onFastImageLoadEnd(@{});
|
||||
}
|
||||
}
|
||||
@@ -46,7 +46,7 @@
|
||||
|
||||
- (void) setOnFastImageError: (RCTDirectEventBlock)onFastImageError {
|
||||
_onFastImageError = onFastImageError;
|
||||
- if (self.hasErrored) {
|
||||
+ if (self.hasErrored && _onFastImageError != NULL) {
|
||||
_onFastImageError(@{});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user