Fix wishlist, if empty
This commit is contained in:
parent
f13412aba9
commit
8e94f1d6f5
2 changed files with 5 additions and 3 deletions
|
@ -77,8 +77,7 @@ class ShopWidget(QScrollArea, Ui_ShopWidget):
|
|||
item = self.discount_widget.layout().itemAt(i)
|
||||
if item:
|
||||
item.widget().deleteLater()
|
||||
|
||||
if wishlist[0] == "error":
|
||||
if wishlist and wishlist[0] == "error":
|
||||
self.discount_widget.layout().addWidget(QLabel(self.tr("Failed to get wishlist: ") + wishlist[1]))
|
||||
btn = QPushButton(self.tr("Reload"))
|
||||
self.discount_widget.layout().addWidget(btn)
|
||||
|
|
|
@ -364,7 +364,10 @@ class ImageLabel(QLabel):
|
|||
self.show_image()
|
||||
|
||||
def image_ready(self, data):
|
||||
self.setPixmap(QPixmap())
|
||||
try:
|
||||
self.setPixmap(QPixmap())
|
||||
except Exception:
|
||||
logger.warning("C++ object already removed, when image ready")
|
||||
try:
|
||||
image: Image.Image = Image.open(io.BytesIO(data))
|
||||
except PIL.UnidentifiedImageError:
|
||||
|
|
Loading…
Reference in a new issue