From: Ilkka Ollakka Date: Thu, 24 Jun 2010 15:06:25 +0000 (+0300) Subject: Qt4: check that index.isValid too X-Git-Tag: 1.2.0-pre1~6076 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=f9fe9f294474e6c286ff458522e5dd373f92564d;p=vlc Qt4: check that index.isValid too --- diff --git a/modules/gui/qt4/components/playlist/playlist_model.cpp b/modules/gui/qt4/components/playlist/playlist_model.cpp index 75d885bf2e..a1f1412e0a 100644 --- a/modules/gui/qt4/components/playlist/playlist_model.cpp +++ b/modules/gui/qt4/components/playlist/playlist_model.cpp @@ -388,6 +388,9 @@ QVariant PLModel::data( const QModelIndex &index, int role ) const /* Seek from current index toward the top and see if index is one of parent nodes */ bool PLModel::isParent( const QModelIndex &index, const QModelIndex ¤t ) const { + if( !index.isValid() ) + return false; + if( index == current ) return true;