From 361eebc6f3e07bb09e726c0a6724991a4dab9de2 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Wed, 31 Aug 2022 10:41:28 -0700 Subject: [PATCH] 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. --- UI/scene-tree.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UI/scene-tree.cpp b/UI/scene-tree.cpp index e6ea92843..5ed8eb412 100644 --- a/UI/scene-tree.cpp +++ b/UI/scene-tree.cpp @@ -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()); }