question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Crash on Android if source is an invalid URL

See original GitHub issue

If I pass as source an object like this { uri: 'INVALID_URL' } I get the following error on Android:

Error while updating property 'source' of a view managed by: FastImageView

null

Must not be null or empty

At the moment I am normalising the source using this (ugly) code to avoid the crash:

const normalisedSource = source && typeof source.uri === 'string' && !source.uri.split('https://')[1] ? null : source;

but I think it would be better if the library prevents it.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:13
  • Comments:15

github_iconTop GitHub Comments

12reactions
OrangeFlavoredColdCoffeecommented, Mar 25, 2019

not all image start https, http ?? const normalisedSource = source && typeof source.uri === ‘string’ && !source.uri.split(‘http’)[1] ? null : source;

7reactions
z3r0c00l-2kcommented, Dec 5, 2020

I think the library itself should take of this issue, on ios it works perfectly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Startactivity(intent) handle invalid url - android - Stack Overflow
im getting some urls from firebase to download a pdf in a repository of my collage in a fragment , thats work fine,...
Read more >
Chrome for Android Crashes when an intent is triggered from ...
Steps to reproduce the problem: 1. Basically the crash can be triggered by invoking a virtual method on a NULL object reference by...
Read more >
Crashes - Android Developers
An app that is written using Java or Kotlin crashes if it throws an unhandled exception, represented by the Throwable class.
Read more >
Game crashing when Android MediaPlayer fails to open URL
I am building for Gear VR (so, Android ETC2). At the beginning of my game, I have a MediaPlayer starting in auto, opening...
Read more >
6390b37a3b32fc7583154d53fda...
Stop using invalid URL to prevent unexpected crash Verify the input PAC Uri ... Check if the URL is a valid URL to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found