IGN:Show meaningful error if user tries to set cover from format with no format selected

This commit is contained in:
Kovid Goyal 2009-02-11 13:26:38 -08:00
parent 2b4a4a31e3
commit fbb6a3917e

View File

@ -113,6 +113,10 @@ class MetadataSingleDialog(ResizableDialog, Ui_MetadataSingleDialog):
def set_cover(self): def set_cover(self):
row = self.formats.currentRow() row = self.formats.currentRow()
fmt = self.formats.item(row) fmt = self.formats.item(row)
if fmt is None:
error_dialog(self, _('No format selected'),
_('No format selected')).exec_()
return
ext = fmt.ext.lower() ext = fmt.ext.lower()
if fmt.path is None: if fmt.path is None:
stream = self.db.format(self.row, ext, as_file=True) stream = self.db.format(self.row, ext, as_file=True)