mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fabric: Fixed a crash in RCTImageComponentView
Summary: The app crashed on assert which was not actually legit. See the comment in the code. Reviewed By: JoshuaGross Differential Revision: D15976177 fbshipit-source-id: 612bbbd510187ffdc86369aa943d4b652b748694
This commit is contained in:
committed by
Facebook Github Bot
parent
7d2a95d43d
commit
970bd2c69c
@@ -78,7 +78,13 @@
|
||||
{
|
||||
SharedImageLocalData previousData = _imageLocalData;
|
||||
_imageLocalData = std::static_pointer_cast<const ImageLocalData>(localData);
|
||||
assert(_imageLocalData);
|
||||
|
||||
if (!_imageLocalData) {
|
||||
// This might happen in very rare cases (e.g. inside a subtree inside a node with `display: none`).
|
||||
// That's quite normal.
|
||||
return;
|
||||
}
|
||||
|
||||
bool havePreviousData = previousData != nullptr;
|
||||
|
||||
if (!havePreviousData || _imageLocalData->getImageSource() != previousData->getImageSource()) {
|
||||
|
||||
Reference in New Issue
Block a user