Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Fix #7907: Crash when downloading images in Wallet with invalid URL (#…
Browse files Browse the repository at this point in the history
…7908)

Verify given `URL` is a valid before passing to `WebImageDownloader`
  • Loading branch information
StephenHeaps committed Aug 21, 2023
1 parent 639c7d4 commit 0dfdb8c
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import BraveUI

extension BraveCore.WebImageDownloader: WebImageDownloaderType {
@MainActor public func downloadImage(url: URL) async -> UIImage? {
guard url.isWebPage() else { return nil }
return await withCheckedContinuation { continuation in
downloadImage(url) { image, _, _ in
continuation.resume(returning: image)
Expand Down

0 comments on commit 0dfdb8c

Please sign in to comment.