mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12: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
|
return html_content, internal
|
||||||
|
|
||||||
# favour url if it's a local link
|
# 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)
|
types = (self._processUrls, self._processImage, self._processText)
|
||||||
else:
|
else:
|
||||||
types = (self._processImage, self._processUrls, self._processText)
|
types = (self._processImage, self._processUrls, self._processText)
|
||||||
|
|
Loading…
Reference in a new issue