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.
master
jp9000 2022-08-31 10:41:28 -07:00
parent 3cde5dd48a
commit 361eebc6f3
1 changed files with 1 additions and 1 deletions

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());
}