summaryrefslogtreecommitdiffstats
path: root/desktop-widgets
diff options
context:
space:
mode:
authorGravatar Jan Mulder <jlmulder@xs4all.nl>2017-03-25 11:51:37 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-03-26 21:58:29 -0700
commit588a83e339155094ba7c3ac4c15f29288a145352 (patch)
tree7722484e92734af900fcf75e208a233e3f0e77b2 /desktop-widgets
parentbd0c99dfb7146d91021ebb3bd7b020b76573fabc (diff)
downloadsubsurface-588a83e339155094ba7c3ac4c15f29288a145352.tar.gz
Fix issue 280: Facebook without a dive selected
Accessing Facebook stuff without a dive selected (as in an empty logbook) just SIGSEGVs. Just be more carefull. After this fix, it is still possible to upload an "empty dive" to FB. Ok, a little pointless, but a nice picture of the Subsurface logo is uploaded to FB. Consider it an easter egg :-) Fixes: #280 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Diffstat (limited to 'desktop-widgets')
-rw-r--r--desktop-widgets/plugins/facebook/facebookconnectwidget.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/desktop-widgets/plugins/facebook/facebookconnectwidget.cpp b/desktop-widgets/plugins/facebook/facebookconnectwidget.cpp
index 419a823ca..969f7a118 100644
--- a/desktop-widgets/plugins/facebook/facebookconnectwidget.cpp
+++ b/desktop-widgets/plugins/facebook/facebookconnectwidget.cpp
@@ -296,6 +296,10 @@ void SocialNetworkDialog::selectionChanged()
{
struct dive *d = current_dive;
QString fullText;
+
+ if (!d)
+ return;
+
if (ui->date->isChecked()) {
fullText += tr("Dive date: %1 \n").arg(get_short_dive_date_string(d->when));
}