From 94fc2f9c3da86bcfb550a56b2311012140522011 Mon Sep 17 00:00:00 2001 From: sledgehammer999 Date: Sat, 30 Aug 2014 19:52:57 +0300 Subject: [PATCH] Don't display the context menu in 'Content' and 'HTTP Sources' buttons when no torrent is selected. It prevents crashes. Closes #1906, #1900. --- src/properties/propertieswidget.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/properties/propertieswidget.cpp b/src/properties/propertieswidget.cpp index 3e5f9f5f9..74188800a 100644 --- a/src/properties/propertieswidget.cpp +++ b/src/properties/propertieswidget.cpp @@ -466,6 +466,8 @@ void PropertiesWidget::openFolder(const QModelIndex &index, bool containing_fold } void PropertiesWidget::displayFilesListMenu(const QPoint&) { + if (!h.is_valid()) + return; QMenu myFilesLlistMenu; QModelIndexList selectedRows = filesList->selectionModel()->selectedRows(0); QAction *actOpen = 0; @@ -521,6 +523,8 @@ void PropertiesWidget::displayFilesListMenu(const QPoint&) { } void PropertiesWidget::displayWebSeedListMenu(const QPoint&) { + if (!h.is_valid()) + return; QMenu seedMenu; QModelIndexList rows = listWebSeeds->selectionModel()->selectedRows(); QAction *actAdd = seedMenu.addAction(IconProvider::instance()->getIcon("list-add"), tr("New Web seed"));