diff options
Diffstat (limited to 'desktop-widgets/locationinformation.cpp')
-rw-r--r-- | desktop-widgets/locationinformation.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/desktop-widgets/locationinformation.cpp b/desktop-widgets/locationinformation.cpp index d935c4145..74dfb3e64 100644 --- a/desktop-widgets/locationinformation.cpp +++ b/desktop-widgets/locationinformation.cpp @@ -299,12 +299,13 @@ QVariant DiveLocationModel::data(const QModelIndex &index, int role) const case Qt::DisplayRole: return new_ds_value[index.row()]; case Qt::ToolTipRole: - return displayed_dive.dive_site ? + return current_dive && current_dive->dive_site ? tr("Create a new dive site, copying relevant information from the current dive.") : tr("Create a new dive site with this name"); case Qt::DecorationRole: return plusIcon; } + return QVariant(); } // The dive sites are -2 because of the first two items. |