Skip to content

Commit

Permalink
Fix brave/brave-ios#7907: Crash when downloading images in Wallet wit…
Browse files Browse the repository at this point in the history
…h invalid URL (brave/brave-ios#7908)

Verify given `URL` is a valid before passing to `WebImageDownloader`
  • Loading branch information
StephenHeaps authored Aug 21, 2023
1 parent 4db0bca commit 3114642
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 3114642

Please sign in to comment.