mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-03-05 07:06:13 -05:00
UI: Fix crash with adding source
Bug introduced with adba393ca8
OBS would crash when adding a new source because the source tree item's
widget would be NULL in the sizeHint function when the list item is first
created.
This commit is contained in:
@@ -1757,5 +1757,8 @@ QSize SourceTreeDelegate::sizeHint(const QStyleOptionViewItem &,
|
||||
SourceTree *tree = qobject_cast<SourceTree *>(parent());
|
||||
QWidget *item = tree->indexWidget(index);
|
||||
|
||||
if (!item)
|
||||
return (QSize(0, 0));
|
||||
|
||||
return (QSize(item->width(), item->height()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user