mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
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
1 changed files with 5 additions and 1 deletions
|
@ -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 a new issue