pamhyr: Catch some table data type exception (crash Fix).

This commit is contained in:
Pierre-Antoine Rouby committed 2023-08-04 10:40:32 +02:00
1 parent e8ae1c0631
commit 464209b6e5
21 files changed
+303 -190

No files matched your search

+13 -5
View File
@@ -16,6 +16,8 @@
# -*- coding: utf-8 -*-
import logging
import traceback
from tools import trace, timer
from PyQt5.QtCore import (
@@ -39,6 +41,8 @@ from View.InitialConditions.UndoCommand import (
from View.InitialConditions.translate import *
logger = logging.getLogger()
_translate = QCoreApplication.translate
class ComboBoxDelegate(QItemDelegate):
@@ -135,12 +139,16 @@ class TableModel(QAbstractTableModel):
row = index.row()
column = index.column()
if self._headers[column] is not None:
self._undo.push(
SetCommand(
self._ics, row, self._headers[column], value
try:
if self._headers[column] is not None:
self._undo.push(
SetCommand(
self._ics, row, self._headers[column], value
)
)
)
except Exception as e:
logger.info(e)
logger.debug(traceback.format_exc())
self.dataChanged.emit(index, index)
return True