diff --git a/hexrdgui/indexing/run.py b/hexrdgui/indexing/run.py index 66fe6d1d2..5e6e497ad 100644 --- a/hexrdgui/indexing/run.py +++ b/hexrdgui/indexing/run.py @@ -380,6 +380,7 @@ def generate_grains_table(self): num_grains = self.qbar.shape[1] if num_grains == 0: print('No grains found') + self.grains_table = None return plural = 's' if num_grains != 1 else '' diff --git a/hexrdgui/rerun_clustering_dialog.py b/hexrdgui/rerun_clustering_dialog.py index dc9d10d68..60db01262 100644 --- a/hexrdgui/rerun_clustering_dialog.py +++ b/hexrdgui/rerun_clustering_dialog.py @@ -2,7 +2,7 @@ from pathlib import Path from PySide6.QtWidgets import QDialog, QFileDialog -from PySide6.QtCore import Qt +from PySide6.QtCore import QTimer, Qt from hexrdgui.async_worker import AsyncWorker from hexrdgui.hexrd_config import HexrdConfig @@ -89,6 +89,10 @@ def on_finished(): runner.accept_progress() runner.confirm_indexing_results() + if runner.grains_table is None: + # The previous step must have failed. Show again. + QTimer.singleShot(0, self.exec) + def on_rejected(): # Since this is a QueuedConnection, we need to accept progress here runner.accept_progress()