mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-09-13 20:23:04 +02:00
Check QAbstractItemModel for nullptr before access. #2
This commit is contained in:
parent
a61d70e40e
commit
c31cab34e4
@ -172,10 +172,12 @@ bool ElementsCollectionModel::dropMimeData(const QMimeData *data,
|
||||
const QModelIndex &parent)
|
||||
{
|
||||
Q_UNUSED(action)
|
||||
QStandardItem *qsi = itemFromIndex(
|
||||
parent.QModelIndex::model()->index(row, column));
|
||||
if (!qsi)
|
||||
qsi = itemFromIndex(parent);
|
||||
|
||||
const QAbstractItemModel* qaim = parent.QModelIndex::model();
|
||||
if (! qaim) return false;
|
||||
|
||||
QStandardItem* qsi = itemFromIndex(qaim->index(row, column));
|
||||
if (! qsi) qsi = itemFromIndex(parent);
|
||||
|
||||
if (qsi->type() == FileElementCollectionItem::Type)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user