Check QAbstractItemModel for nullptr before access. #2

This commit is contained in:
Pascal Sander 2025-08-17 10:33:04 +02:00
parent a61d70e40e
commit c31cab34e4

View File

@ -172,10 +172,12 @@ bool ElementsCollectionModel::dropMimeData(const QMimeData *data,
const QModelIndex &parent) const QModelIndex &parent)
{ {
Q_UNUSED(action) Q_UNUSED(action)
QStandardItem *qsi = itemFromIndex(
parent.QModelIndex::model()->index(row, column)); const QAbstractItemModel* qaim = parent.QModelIndex::model();
if (!qsi) if (! qaim) return false;
qsi = itemFromIndex(parent);
QStandardItem* qsi = itemFromIndex(qaim->index(row, column));
if (! qsi) qsi = itemFromIndex(parent);
if (qsi->type() == FileElementCollectionItem::Type) if (qsi->type() == FileElementCollectionItem::Type)
{ {