]> git.sesse.net Git - vlc/commitdiff
Qt: be sure that the conversion to Int from TYPE_ROLE worked
authorJean-Baptiste Kempf <jb@videolan.org>
Tue, 8 Sep 2009 08:33:44 +0000 (10:33 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Tue, 8 Sep 2009 08:33:44 +0000 (10:33 +0200)
modules/gui/qt4/components/playlist/selector.cpp

index 5ec816b6f5fa7600297a1b38f040d423c05c1642..4c60a00783aa1a9f81f640975d9d570bccbc2213 100644 (file)
@@ -70,7 +70,10 @@ void PLSelector::setSource( QTreeWidgetItem *item )
     if( !item )
         return;
 
-    int i_type = item->data( 0, TYPE_ROLE ).toInt();
+    bool b_ok;
+    int i_type = item->data( 0, TYPE_ROLE ).toInt( &b_ok );
+    if( !b_ok )
+        return;
 
     assert( ( i_type == PL_TYPE || i_type == ML_TYPE || i_type == SD_TYPE ) );
     if( i_type == SD_TYPE )