Merge pull request #274 from dlon/clipboard-crash

Fix crash caused by cutting and copying events that don't modify the clipboard
This commit is contained in:
Damien Elmes 2019-01-29 08:22:21 +10:00 committed by GitHub
commit 819637721c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -971,6 +971,8 @@ class EditorWebView(AnkiWebView):
# add a comment in the clipboard html so we can tell text is copied
# from us and doesn't need to be stripped
clip = self.editor.mw.app.clipboard()
if not clip.ownsClipboard():
return
mime = clip.mimeData()
if not mime.hasHtml():
return