Skip to content

Commit 027f20e

Browse files
committed
BUG: Fix crash in ctkSliderWidgetPrivate::synchronizeSiblingWidth
1 parent 64f2e07 commit 027f20e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Libs/Widgets/ctkSliderWidget.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ void ctkSliderWidgetPrivate::synchronizeSiblingWidth(int width)
136136
{
137137
Q_UNUSED(width);
138138
Q_Q(const ctkSliderWidget);
139+
if (!q->parent())
140+
{
141+
return;
142+
}
139143
QList<ctkSliderWidget*> siblings =
140144
q->parent()->findChildren<ctkSliderWidget*>();
141145
foreach(ctkSliderWidget* sibling, siblings)
@@ -154,6 +158,10 @@ void ctkSliderWidgetPrivate::synchronizeSiblingDecimals(int decimals)
154158
{
155159
Q_UNUSED(decimals);
156160
Q_Q(const ctkSliderWidget);
161+
if (!q->parent())
162+
{
163+
return;
164+
}
157165
QList<ctkSliderWidget*> siblings =
158166
q->parent()->findChildren<ctkSliderWidget*>();
159167
foreach(ctkSliderWidget* sibling, siblings)

0 commit comments

Comments
 (0)