Fix crash on iOS when ledger asks for a favicon with an invalid URL
This commit is contained in:
+5
-3
@@ -1680,11 +1680,13 @@ BATLedgerBridge(BOOL,
|
||||
|
||||
- (void)fetchFavIcon:(const std::string &)url faviconKey:(const std::string &)favicon_key callback:(ledger::client::FetchIconCallback)callback
|
||||
{
|
||||
if (!self.faviconFetcher) {
|
||||
callback(NO, std::string());
|
||||
const auto pageURL = [NSURL URLWithString:[NSString stringWithUTF8String:url.c_str()]];
|
||||
if (!self.faviconFetcher || !pageURL) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
callback(NO, std::string());
|
||||
});
|
||||
return;
|
||||
}
|
||||
const auto pageURL = [NSURL URLWithString:[NSString stringWithUTF8String:url.c_str()]];
|
||||
self.faviconFetcher(pageURL, ^(NSURL * _Nullable faviconURL) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
callback(faviconURL != nil,
|
||||
|
||||
Reference in New Issue
Block a user