]> git.sesse.net Git - vlc/commitdiff
Qt: fix crash in the playlist model
authorJean-Philippe André <jpeg@videolan.org>
Tue, 18 Jan 2011 14:26:10 +0000 (15:26 +0100)
committerJean-Philippe André <jpeg@videolan.org>
Tue, 18 Jan 2011 14:29:46 +0000 (15:29 +0100)
Bug: right-click on an empty node leads to a segfault

modules/gui/qt4/components/playlist/playlist_model.cpp

index 13854935e2d9c37ac2de3dd6f26b9f6c94652943..25735b3071cf82e8e9f474107af2ccbf6c60bb9b 100644 (file)
@@ -922,9 +922,11 @@ bool PLModel::popup( const QModelIndex & index, const QPoint &point, const QMode
                         qtr(I_POP_STREAM), this, SLOT( popupStream() ) );
         menu.addAction( qtr(I_POP_SAVE), this, SLOT( popupSave() ) );
         menu.addAction( QIcon( ":/menu/info" ), qtr(I_POP_INFO), this, SLOT( popupInfo() ) );
-        if( !strncasecmp( p_input->psz_uri, "file://", 7 ) )
+        if( p_input->psz_uri && !strncasecmp( p_input->psz_uri, "file://", 7 ) )
+        {
             menu.addAction( QIcon( ":/type/folder-grey" ),
                             qtr( I_POP_EXPLORE ), this, SLOT( popupExplore() ) );
+        }
         menu.addSeparator();
     }
     if( canEdit() )