Commit 19ac05a9 authored by Julius Künzel's avatar Julius Künzel
Browse files

Fix crash when dropping audio/video only from monitor to bin

parent f5b900f7
...@@ -206,14 +206,18 @@ bool ProjectItemModel::dropMimeData(const QMimeData *data, Qt::DropAction action ...@@ -206,14 +206,18 @@ bool ProjectItemModel::dropMimeData(const QMimeData *data, Qt::DropAction action
// subclip zone // subclip zone
QStringList clipData = ids.constFirst().split(QLatin1Char('/')); QStringList clipData = ids.constFirst().split(QLatin1Char('/'));
if (clipData.length() >= 3) { if (clipData.length() >= 3) {
QString id; QString bid = clipData.at(0);
std::shared_ptr<ProjectClip> masterClip = getClipByBinID(clipData.at(0)); if (bid.startsWith(QLatin1Char('A')) || bid.startsWith(QLatin1Char('V'))) {
bid.remove(0, 1);
}
std::shared_ptr<ProjectClip> masterClip = getClipByBinID(bid);
std::shared_ptr<ProjectSubClip> sub = masterClip->getSubClip(clipData.at(1).toInt(), clipData.at(2).toInt()); std::shared_ptr<ProjectSubClip> sub = masterClip->getSubClip(clipData.at(1).toInt(), clipData.at(2).toInt());
if (sub != nullptr) { if (sub != nullptr) {
// This zone already exists // This zone already exists
return false; return false;
} }
return requestAddBinSubClip(id, clipData.at(1).toInt(), clipData.at(2).toInt(), {}, clipData.at(0)); QString id;
return requestAddBinSubClip(id, clipData.at(1).toInt(), clipData.at(2).toInt(), {}, bid);
} else { } else {
// error, malformed clip zone, abort // error, malformed clip zone, abort
return false; return false;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment