diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-01-29 13:37:32 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-01-29 13:37:32 -0800 |
commit | 4e40872fc0ec5df8fd24e71e142f79ce5333307e (patch) | |
tree | 17acf0d4cc40408ed9f735d0288aa9912604ec48 | |
parent | 962e71d495c5184cde7a33259ef945417334f0f0 (diff) | |
download | subsurface-4e40872fc0ec5df8fd24e71e142f79ce5333307e.tar.gz |
Prevent potential access to uninitialized variable
If we have a dive with no data (e.g. from a failed import), we might never
assign a value otherwise.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | qt-ui/profile/diveprofileitem.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/qt-ui/profile/diveprofileitem.cpp b/qt-ui/profile/diveprofileitem.cpp index 81e91c771..3f64fd47a 100644 --- a/qt-ui/profile/diveprofileitem.cpp +++ b/qt-ui/profile/diveprofileitem.cpp @@ -572,7 +572,7 @@ DiveMeanDepthItem::DiveMeanDepthItem() void DiveMeanDepthItem::modelDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight) { - double meandepthvalue; + double meandepthvalue = 0.0; // We don't have enougth data to calculate things, quit. if (!shouldCalculateStuff(topLeft, bottomRight)) return; |