[vlc-devel] [PATCH] qt: menus: fix crash with skins2

Alexandre Janniaux ajanni at videolabs.io
Wed Dec 23 10:36:59 UTC 2020


---
 modules/gui/qt/menus/menus.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/gui/qt/menus/menus.cpp b/modules/gui/qt/menus/menus.cpp
index 592fbc103f..af0b0c9eb2 100644
--- a/modules/gui/qt/menus/menus.cpp
+++ b/modules/gui/qt/menus/menus.cpp
@@ -221,7 +221,7 @@ QMenu *VLCMenuBar::FileMenu( intf_thread_t *p_intf, QMenu *menu, MainInterface *
     addDPStaticEntry( menu, qtr( "Open &Location from clipboard" ),
                       NULL, &DialogsProvider::openUrlDialog, "Ctrl+V" );
 
-    if( var_InheritBool( p_intf, "qt-recentplay" ) && mi->hasMediaLibrary() )
+    if( mi && var_InheritBool( p_intf, "qt-recentplay" ) && mi->hasMediaLibrary() )
     {
         MLRecentsModel* recentModel = new MLRecentsModel(nullptr);
         recentModel->setMl(mi->getMediaLibrary());
@@ -530,7 +530,7 @@ QMenu *VLCMenuBar::NavigMenu( intf_thread_t *p_intf, QMenu *menu )
     menu->addMenu( submenu );
     menu->addMenu( new CheckableListMenu( qtr("&Program") , THEMIM->getPrograms(), CheckableListMenu::GROUPED , menu) );
 
-    if (p_intf->p_sys->p_mi->hasMediaLibrary() )
+    if (p_intf->p_sys->p_mi && p_intf->p_sys->p_mi->hasMediaLibrary() )
     {
         submenu = new QMenu( qtr( I_MENU_BOOKMARK ), menu );
         submenu->setTearOffEnabled( true );
-- 
2.29.2



More information about the vlc-devel mailing list