]> git.sesse.net Git - vlc/commitdiff
Qt: Fix getMRL() and QList<T>::operator[]: "index out of range". Close #2458
authorJean-Baptiste Kempf <jb@videolan.org>
Tue, 27 Jan 2009 08:54:01 +0000 (09:54 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Tue, 27 Jan 2009 08:54:01 +0000 (09:54 +0100)
modules/gui/qt4/dialogs/open.cpp

index 50761f2f8fcca38379ac590e207098b55d7d6b33..27ea8684c1dc0bdad78a2a178b364a619078df46 100644 (file)
@@ -190,6 +190,7 @@ OpenDialog::~OpenDialog()
 /* Used by VLM dialog and inputSlave selection */
 QString OpenDialog::getMRL( bool b_all )
 {
+    if( itemsMRL.size() == 0 ) return "";
     return b_all ? itemsMRL[0] + ui.advancedLineInput->text()
                  : itemsMRL[0];
 }
@@ -377,6 +378,7 @@ void OpenDialog::transcode()
 void OpenDialog::stream( bool b_transcode_only )
 {
     QString soutMRL = getMRL();
+    if( soutMRL.isEmpty() ) return;
     toggleVisible();
 
     /* Dbg and send :D */