]> git.sesse.net Git - vlc/commitdiff
Don't crash if I click "cancel" in getOpenFileNames
authorGeoffroy Couprie <geal@videolan.org>
Fri, 25 Dec 2009 15:20:42 +0000 (16:20 +0100)
committerGeoffroy Couprie <geal@videolan.org>
Sat, 26 Dec 2009 15:24:06 +0000 (16:24 +0100)
modules/gui/qt4/dialogs_provider.cpp

index 29177ced8030658502e593b166e3b3076f26d9b7..b1d9e22bd9623c9e6e9432b159f579c07e7716db 100644 (file)
@@ -309,7 +309,10 @@ void DialogsProvider::openFileGenericDialog( intf_dialog_args_t *p_arg )
         i = 0;
         foreach( const QString &file, files )
             p_arg->psz_results[i++] = strdup( qtu( toNativeSepNoSlash( file ) ) );
-        p_intf->p_sys->filepath = qfu( p_arg->psz_results[i] );
+        if(i == 0)
+            p_intf->p_sys->filepath = QString::fromAscii("");
+        else
+            p_intf->p_sys->filepath = qfu( p_arg->psz_results[i] );
     }
 
     /* Callback */