]> git.sesse.net Git - vlc/commitdiff
Qt: fix crashes possible in Hotkey settings.
authorJean-Baptiste Kempf <jb@videolan.org>
Thu, 9 Apr 2009 16:14:22 +0000 (18:14 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Thu, 9 Apr 2009 16:14:56 +0000 (18:14 +0200)
modules/gui/qt4/components/preferences_widgets.cpp

index ebd01d00d446c807465d00006d64d976635ef4dd..96dcb92c91af7a451ddd31d550960bc3fb57e185 100644 (file)
@@ -1248,6 +1248,7 @@ void KeySelectorControl::finish()
 void KeySelectorControl::select1Key()
 {
     QTreeWidgetItem *keyItem = table->currentItem();
+    if( !keyItem ) return;
     shortcutValue->setText( keyItem->text( 1 ) );
     shortcutValue->setValue( keyItem->data( 1, Qt::UserRole ).toInt() );
 }
@@ -1293,6 +1294,7 @@ void KeySelectorControl::selectKey( QTreeWidgetItem *keyItem )
 
 void KeySelectorControl::setTheKey()
 {
+    if( !table->currentItem() ) return;
     table->currentItem()->setText( 1, shortcutValue->text() );
     table->currentItem()->setData( 1, Qt::UserRole, shortcutValue->getValue() );
 }