Check if dive_site exists before accessing its name

... in copy dive to clipboad.

Fixes #2109

Signed-off-by: Robert C. Helling <helling@atdotde.de>
This commit is contained in:
Robert C. Helling 2019-05-28 22:54:58 +02:00 committed by bstoeger
parent f6ab84f13f
commit b614a04330

View file

@ -496,7 +496,7 @@ void DiveComponentSelection::buttonClicked(QAbstractButton *button)
QTextStream text;
QString cliptext;
text.setString(&cliptext);
if (what->divesite)
if (what->divesite && displayed_dive.dive_site)
text << tr("Dive site: ") << displayed_dive.dive_site->name << "\n";
if (what->divemaster)
text << tr("Dive master: ") << displayed_dive.divemaster << "\n";