hasUrls() may be true even if there are no URLs
Silences the error on https://forums.ankiweb.net/t/error-message-with-forvo/28529
This commit is contained in:
parent
77a45365cb
commit
516748c782
@ -1294,7 +1294,11 @@ class EditorWebView(AnkiWebView):
|
||||
return html_content, internal
|
||||
|
||||
# favour url if it's a local link
|
||||
if mime.hasUrls() and mime.urls()[0].toString().startswith("file://"):
|
||||
if (
|
||||
mime.hasUrls()
|
||||
and (urls := mime.urls())
|
||||
and urls[0].toString().startswith("file://")
|
||||
):
|
||||
types = (self._processUrls, self._processImage, self._processText)
|
||||
else:
|
||||
types = (self._processImage, self._processUrls, self._processText)
|
||||
|
Loading…
Reference in New Issue
Block a user