diff --git a/qt/aqt/editor.py b/qt/aqt/editor.py index 34f2cac35..4bda62e0e 100644 --- a/qt/aqt/editor.py +++ b/qt/aqt/editor.py @@ -1341,8 +1341,9 @@ class EditorWebView(AnkiWebView): for qurl in mime.urls(): url = qurl.toString() # chrome likes to give us the URL twice with a \n - url = url.splitlines()[0] - buf += self.editor.urlToLink(url) + if lines := url.splitlines(): + url = lines[0] + buf += self.editor.urlToLink(url) return buf