aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-01-09 14:55:21 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-01-09 15:06:25 -0800
commitf10b66237e10f77d026335e9d39ad8a99a8f01bf (patch)
tree1addacaf8323922d375804b2aa655f748d29e04d
parent7357633905cf3bb33a99f7c0b54d214f49373411 (diff)
downloadsubsurface-f10b66237e10f77d026335e9d39ad8a99a8f01bf.tar.gz
If we can't find the dive, simply return no data
This seems better than forcing a crash or accessing random data. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/models.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp
index 0778b7bca..9246a0b07 100644
--- a/qt-ui/models.cpp
+++ b/qt-ui/models.cpp
@@ -1138,6 +1138,8 @@ QVariant DiveItem::data(int column, int role) const
{
QVariant retVal;
struct dive *dive = get_dive_by_uniq_id(diveId);
+ if (!dive)
+ return QVariant();
switch (role) {
case Qt::TextAlignmentRole: