Clicks in empty message shouldn't produce an error

This commit is contained in:
mailchuck 2016-01-10 17:46:22 +01:00
parent bf93a394c0
commit d09efca9f0
Signed by untrusted user who does not match committer: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87

View File

@ -26,7 +26,7 @@ class MessageView(QtGui.QTextBrowser):
def mousePressEvent(self, event): def mousePressEvent(self, event):
#text = textCursor.block().text() #text = textCursor.block().text()
if event.button() == QtCore.Qt.LeftButton and self.html.has_html and self.cursorForPosition(event.pos()).block().blockNumber() == 0: if event.button() == QtCore.Qt.LeftButton and self.html and self.html.has_html and self.cursorForPosition(event.pos()).block().blockNumber() == 0:
if self.mode == MessageView.MODE_PLAIN: if self.mode == MessageView.MODE_PLAIN:
self.showHTML() self.showHTML()
else: else: