From 4c3008e25cfae1440552798c00b51c7a9ef91443 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 6 Apr 2012 07:36:48 +0900 Subject: [PATCH] don't error when an image is dropped on itself --- aqt/editor.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/aqt/editor.py b/aqt/editor.py index 9d0634f24..2de01868b 100644 --- a/aqt/editor.py +++ b/aqt/editor.py @@ -892,9 +892,11 @@ class EditorWebView(AnkiWebView): oldmime = evt.mimeData() # coming from this program? if evt.source(): - assert oldmime.hasHtml() - mime = QMimeData() - mime.setHtml(self._filteredHTML(oldmime.html())) + if oldmime.hasHtml(): + mime = QMimeData() + mime.setHtml(self._filteredHTML(oldmime.html())) + else: + mime = oldmime else: mime = self._processMime(oldmime) # create a new event with the new mime data