Do not crash on attempt to export blank fitting

This commit is contained in:
DarkPhoenix
2019-08-23 09:07:31 +03:00
parent fce8129fa2
commit 67462c3278

View File

@@ -273,7 +273,15 @@ class ExportToEve(AuxiliaryFrame):
sEsi = Esi.getInstance()
sFit = Fit.getInstance()
data = sPort.exportESI(sFit.getFit(fitID))
try:
data = sPort.exportESI(sFit.getFit(fitID))
except ESIExportException as e:
msg = str(e)
if not msg:
msg = "Failed to generate export data"
pyfalog.warning(msg)
self.statusbar.SetStatusText(msg, 1)
return
activeChar = self.getActiveCharacter()
if activeChar is None:
msg = "Need at least one ESI character to export"