Closed gjsman closed 2 years ago
Hey @gjsman!
From what I can see, you should only be getting this with URLs where a favicon can't be fetched properly. Are you also getting this error when trying to grab the favicons from any other URLs? 🙂
https://example.com/
is so far the only URL that I have found that causes this behavior. That would be fine if I could use a try/catch fallback, but the error about the nonexistent member function cannot be caught.
In your particular example, the fetch
method returns null
if the favicon can't be found. So, you could potentially update your code to look like so:
Favicon::fetch("https://example.com/")?->cache(now()->addWeek())->getFaviconUrl();
Does this help a little bit? 🙂
Huh... that works. Thank you!
Perfect! I'm glad that it sorted it for you 😄
Hello,
If I run the following code which looks like it should work:
It will crash with: