Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix crash in slider with custom image
Summary: Changelog: [Internal] # Why was it crashing? Crash was caused by `data.getTrackImageRequest()` returning NULL. The crash happened inside `getCoordinator` method. If you look at the implementation of the method below ``` if (request) { return &request->getObserverCoordinator(); } else { return nullptr; } ``` you might notice that we check for NULL, why is it crashing then? And why is it only crashing in production? The reason is compiler's optimiser, which looks at `data.getTrackImageRequest()`, this method returns `ImageRequest const &` and sees that this method will always return a value, never NULL. Compiler then looks at our `getCoordinator` function, sees that we check there for nullity but since it can never be null, removes that branch. # Solution Create new SliderState with non null image observer. Reviewed By: shergin Differential Revision: D20491367 fbshipit-source-id: 17b7cf31feabbe6f8ece324a3d329902b2ef6a2d
- Loading branch information