forked from IPKM/nmreval
asciireader.py avoid IndexError if file has no header
This commit is contained in:
parent
5577adabec
commit
b73d6f08b8
@ -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())
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user