Skip to content

Commit

Permalink
Fix crash
Browse files Browse the repository at this point in the history
* "Export all Templates" could crash if no CIF was loaded
  • Loading branch information
dkratzert committed Feb 22, 2024
1 parent 52c623a commit 105bf6b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions finalcif/appwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def __init__(self, file: Optional[Path] = None):
self.properties = Properties(parent=self, settings=self.settings)
self.status_bar = StatusBar(ui=self.ui)
self.status_bar.show_message('FinalCif version {}'.format(VERSION))
self.authors: Optional[AuthorLoops] = None
self.authors = AuthorLoops(ui=self.ui, cif=self.cif, app=self)
self.set_window_size_and_position()
self.ui.cif_main_table.installEventFilter(self)
# Sorting desynchronized header and columns:
Expand Down Expand Up @@ -1527,7 +1527,6 @@ def _load_block(self, index: int, load_changes: bool = True) -> None:
self.ui.CCDCNumLineEdit.setText(self.cif['_database_code_depnum_ccdc_archive'])
self.ui.CheckcifPlaintextEdit.clear()
self.ui.TemplatesStackedWidget.setCurrentIndex(0)
self.authors = AuthorLoops(ui=self.ui, cif=self.cif, app=self)
if not (self.ui.MainStackedWidget.on_checkcif_page() or self.ui.MainStackedWidget.on_info_page()):
self.ui.MainStackedWidget.got_to_main_page()
self.deposit.cif = self.cif
Expand Down

0 comments on commit 105bf6b

Please sign in to comment.