0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 04:42:18 +02:00

UI: Fix scene list crash

The original change in obsproject/obs-studio#7200 seems to have been
based upon the idea that if the "selected" parameter has no values, then
the "deselected" parameter must have values, which is clearly an unsafe
assumption to have make given that it causes an assert crash in Qt when
both parameters have 0 values contained within them.
This commit is contained in:
jp9000 2022-08-31 10:41:28 -07:00
parent 3cde5dd48a
commit 361eebc6f3

View File

@ -253,6 +253,6 @@ void SceneTree::rowsInserted(const QModelIndex &parent, int start, int end)
void SceneTree::selectionChanged(const QItemSelection &selected,
const QItemSelection &deselected)
{
if (selected.count() == 0)
if (selected.count() == 0 && deselected.count() > 0)
setCurrentRow(deselected.indexes().front().row());
}