mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
Don't throw on empty URLs in clipboard
https://forums.ankiweb.net/t/dragging-and-dropping-picture-error/32313
This commit is contained in:
parent
3727781522
commit
61f7c70d3c
1 changed files with 3 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue