gravatar: guard against self.response being None
While this condition has never been spotted in the wild, let's make sure that we have data before reading it. Signed-off-by: David Aguilar <davvid@gmail.com>
This commit is contained in:
@@ -111,6 +111,8 @@ class GravatarLabel(QtWidgets.QLabel):
|
||||
self.pixmaps[email] = pixmap
|
||||
|
||||
def set_pixmap_from_response(self):
|
||||
if self.response is None:
|
||||
self.response = self._default_pixmap_bytes()
|
||||
pixmap = QtGui.QPixmap()
|
||||
pixmap.loadFromData(self.response)
|
||||
self.setPixmap(pixmap)
|
||||
|
||||
Reference in New Issue
Block a user