[vlc-commits] Qt: selector, prevent some podcast crashes

Jean-Baptiste Kempf git at videolan.org
Mon Sep 10 17:10:54 CEST 2012


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Mon Sep 10 17:10:37 2012 +0200| [4cd019b153ad9918093eab8472740d480b21f50a] | committer: Jean-Baptiste Kempf

Qt: selector, prevent some podcast crashes

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4cd019b153ad9918093eab8472740d480b21f50a
---

 modules/gui/qt4/components/playlist/selector.cpp |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/modules/gui/qt4/components/playlist/selector.cpp b/modules/gui/qt4/components/playlist/selector.cpp
index 547d002..e948eca 100644
--- a/modules/gui/qt4/components/playlist/selector.cpp
+++ b/modules/gui/qt4/components/playlist/selector.cpp
@@ -41,6 +41,7 @@
 #include <QPainter>
 #include <QPalette>
 #include <QScrollBar>
+#include <assert.h>
 
 #include <vlc_playlist.h>
 #include <vlc_services_discovery.h>
@@ -457,6 +458,8 @@ void PLSelector::plItemAdded( int item, int parent )
 
 void PLSelector::plItemRemoved( int id )
 {
+    if( !podcastsParent ) return;
+
     int c = podcastsParent->childCount();
     for( int i = 0; i < c; i++ )
     {
@@ -495,6 +498,8 @@ void PLSelector::inputItemUpdate( input_item_t *arg )
 
 void PLSelector::podcastAdd( PLSelItem * )
 {
+    assert( podcastsParent );
+
     bool ok;
     QString url = QInputDialog::getText( this, qtr( "Subscribe" ),
                                          qtr( "Enter URL of the podcast to subscribe to:" ),



More information about the vlc-commits mailing list