]> git.sesse.net Git - vlc/commitdiff
Qt: DO NOT use qobject_cast without checking it!
authorJean-Baptiste Kempf <jb@videolan.org>
Sun, 10 Jan 2010 14:56:51 +0000 (15:56 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Sun, 10 Jan 2010 14:57:44 +0000 (15:57 +0100)
How difficult is that?
Fix crash introduced by 1a4bb0599422791234aced46449a017e54ac6115

modules/gui/qt4/components/controller_widget.cpp

index 831c20e03c773d64e478a2d2615b229cef75ffbb..27f7de1f9e0f7f4cafc7df60c6486efff486c8e6 100644 (file)
@@ -183,7 +183,10 @@ void SoundWidget::updateMuteStatus()
     playlist_t *p_playlist = pl_Hold( p_intf );
     b_is_muted = aout_IsMuted( VLC_OBJECT(p_playlist) );
     pl_Release( p_intf );
-    (qobject_cast<SoundSlider *>(volumeSlider))->setMuted( b_is_muted );
+
+    SoundSlider *soundSlider = qobject_cast<SoundSlider *>(volumeSlider);
+    if( soundSlider )
+        soundSlider->setMuted( b_is_muted );
     refreshLabels();
 }