From b73d6f08b8fb8937bbca957e25b28c18d3606e35 Mon Sep 17 00:00:00 2001 From: Dominik Demuth Date: Sat, 25 Feb 2023 19:16:14 +0100 Subject: [PATCH] asciireader.py avoid IndexError if file has no header --- src/gui_qt/io/asciireader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui_qt/io/asciireader.py b/src/gui_qt/io/asciireader.py index 7bf5a06..4a41bc0 100644 --- a/src/gui_qt/io/asciireader.py +++ b/src/gui_qt/io/asciireader.py @@ -113,7 +113,7 @@ class QAsciiReader(QtWidgets.QDialog, Ui_ascii_reader): @QtCore.pyqtSlot(int, name='on_line_spinBox_valueChanged') def set_column_names(self, _): self.ascii_table.setHorizontalHeaderLabels(map(str, range(1, self.ascii_table.columnCount() + 1))) - if self.column_checkBox.isChecked(): + if self.column_checkBox.isChecked() and self.line_spinBox.isEnabled(): header_line = self.reader.header[self.line_spinBox.value()-1] self.ascii_table.setHorizontalHeaderLabels(header_line.split())