mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 18:30:06 +00:00
Validate parent row before dropping mime data in LayerModel
This commit is contained in:
parent
4a66715923
commit
756249c3ad
1 changed files with 7 additions and 0 deletions
|
|
@ -774,6 +774,13 @@ bool LayerModel::dropMimeData(const QMimeData* data,
|
||||||
QDataStream stream(&mimeData, QIODevice::ReadOnly);
|
QDataStream stream(&mimeData, QIODevice::ReadOnly);
|
||||||
std::vector<int> sourceRows {};
|
std::vector<int> sourceRows {};
|
||||||
|
|
||||||
|
// Validate parent row
|
||||||
|
if (parent.row() < 0 || parent.row() >= static_cast<int>(p->layers_.size()))
|
||||||
|
{
|
||||||
|
logger_->warn("Cannot perform drop action, invalid parent row");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Read source rows from QMimeData
|
// Read source rows from QMimeData
|
||||||
while (!stream.atEnd())
|
while (!stream.atEnd())
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue