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

openURL and canOpenURL crash the app if the argument is not a valid link #8837

Closed
max-pv opened this issue Oct 14, 2021 · 1 comment · Fixed by #8844
Closed

openURL and canOpenURL crash the app if the argument is not a valid link #8837

max-pv opened this issue Oct 14, 2021 · 1 comment · Fixed by #8844

Comments

@max-pv
Copy link

max-pv commented Oct 14, 2021

Problem Description

openURL and canOpenURL crash the app if the argument is not a valid link.

Steps To Reproduce

  1. Create a new RNW app,
  2. Import Linking from react-native,
  3. Try calling openURL('test') or canOpenURL('test')
  4. Observe the app crash

Expected Results

The app is not crashing, and canOpenURL returns false

CLI version

6.1.0

Environment

System:
    OS: Windows 10 10.0.19042
    CPU: (16) x64 AMD Ryzen 7 2700 Eight-Core Processor
    Memory: 7.95 GB / 15.95 GB
  Binaries:
    Node: 14.17.3 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 6.14.11 - C:\Program Files\nodejs\npm.CMD
    Watchman: Not Found
  SDKs:
    Android SDK: Not Found
    Windows SDK:
      AllowDevelopmentWithoutDevLicense: Enabled
      AllowAllTrustedApps: Enabled
      Versions: 10.0.16299.0, 10.0.17134.0, 10.0.17763.0, 10.0.18362.0, 10.0.19041.0
  IDEs:
    Android Studio: Not Found
    Visual Studio: 16.8.30804.86 (Visual Studio Enterprise 2019), 17.0.31423.177 (Visual Studio Enterprise 2022)
  Languages:
    Java: 14.0.1 - C:\Program Files\OpenJDK\jdk-14.0.1\bin\javac.EXE
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.1 => 17.0.1
    react-native: 0.66.0 => 0.66.0
    react-native-windows: 0.66.0 => 0.66.0
  npmGlobalPackages:
    *react-native*: Not Found

Target Platform Version

10.0.19041

Target Device(s)

Desktop

Visual Studio Version

Visual Studio 2019

Build Configuration

Debug

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

Here is the repro repo: https://github.com/br4in3x/rnw-linking-problem

Steps to use:

  1. clone
  2. yarn
  3. yarn windows
@max-pv max-pv added the bug label Oct 14, 2021
@ghost ghost added the Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) label Oct 14, 2021
@ghost ghost closed this as completed in #8844 Oct 16, 2021
@max-pv
Copy link
Author

max-pv commented Oct 17, 2021

Thanks @asklar, you're the best!

@ghost ghost added the Needs: Attention 👋 An issue that had been tagged "Needs: Author Feedback" has received activity (label applied by bot) label Oct 17, 2021
@chrisglein chrisglein added Area: Linking and removed Needs: Attention 👋 An issue that had been tagged "Needs: Author Feedback" has received activity (label applied by bot) Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) labels Oct 18, 2021
@chrisglein chrisglein added this to the 0.68 milestone Oct 18, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants