mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
Fix right-click crash on ridelist with no rides
When there are no rides to select in the ride list (e.g. when just created a new user) right click for a context menu will crash since it assumes there will always be a ride selected.
This commit is contained in:
@@ -640,6 +640,8 @@ MainWindow::rideTreeWidgetSelectionChanged()
|
||||
void
|
||||
MainWindow::showTreeContextMenuPopup(const QPoint &pos)
|
||||
{
|
||||
if (treeWidget->selectedItems().size() == 0) return; //none selected!
|
||||
|
||||
RideItem *rideItem = (RideItem *)treeWidget->selectedItems().first();
|
||||
if (rideItem != NULL && rideItem->text(0) != tr("All Rides")) {
|
||||
QMenu menu(treeWidget);
|
||||
|
||||
Reference in New Issue
Block a user