Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image component crashes on iOS when uri is null #28060

Closed
mlazari opened this issue Feb 14, 2020 · 0 comments
Closed

Image component crashes on iOS when uri is null #28060

mlazari opened this issue Feb 14, 2020 · 0 comments
Labels
Needs: Triage 🔍 Resolution: Locked This issue was locked by the bot.

Comments

@mlazari
Copy link
Contributor

mlazari commented Feb 14, 2020

Description:

Rendering an Image with source={{ uri: null }} crashes on iOS with a JSON value '<null>' of type NSNull cannot be converted to NSString error. It seems to have started doing so in version 0.61.0 after this commit: df17ebf
Seems to be a regression of f940e7c

React Native version:

info Fetching system and libraries information...
System:
    OS: macOS 10.15
    CPU: (4) x64 Intel(R) Core(TM) i5-4258U CPU @ 2.40GHz
    Memory: 285.80 MB / 8.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 10.15.1 - ~/.nvm/versions/node/v10.15.1/bin/node
    Yarn: 1.17.3 - /usr/local/bin/yarn
    npm: 6.13.0 - ~/.nvm/versions/node/v10.15.1/bin/npm
  SDKs:
    iOS SDK:
      Platforms: iOS 13.0, DriverKit 19.0, macOS 10.15, tvOS 13.0, watchOS 6.0
    Android SDK:
      API Levels: 26, 27, 28, 29
      Build Tools: 27.0.3, 28.0.2, 28.0.3
      System Images: android-27 | Google APIs Intel x86 Atom
  IDEs:
    Android Studio: 3.5 AI-191.8026.42.35.6010548
    Xcode: 11.0/11A420a - /usr/bin/xcodebuild
  npmPackages:
    react: ^16.10.2 => 16.12.0 
    react-native: ^0.61.5 => 0.61.5

Steps To Reproduce

  1. Create a simple app that renders <Image source={{ uri: null }} />
  2. Run the app on iOS
  3. The app crashes with a JSON value '<null>' of type NSNull cannot be converted to NSString error.

Expected Results

The app should not crash.

Snack, code example, screenshot, or link to a repository:

<Image source={{ uri: null }} />

error

mlazari added a commit to mlazari/react-native that referenced this issue Feb 14, 2020
osdnk pushed a commit to osdnk/react-native that referenced this issue Mar 9, 2020
Summary:
This fixes facebook#28060 with a fix similar to facebook@f940e7c

## Changelog

[iOS] [Fixed] - Fix Image component crashing when uri is null
Pull Request resolved: facebook#28061

Test Plan:
Run an app on iOS that renders `<Image source={{ uri: null }} />`. It should not crash.
![error](https://user-images.githubusercontent.com/4928274/74492398-6bb23e00-4ed7-11ea-8482-664e1786bba8.png)

Reviewed By: sammy-SC

Differential Revision: D20080680

Pulled By: PeteTheHeat

fbshipit-source-id: 119766a4d7eb6804ffd668418a1f158a712a4fe0
@facebook facebook locked as resolved and limited conversation to collaborators Oct 1, 2021
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Oct 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Needs: Triage 🔍 Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants