From 4e40872fc0ec5df8fd24e71e142f79ce5333307e Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Thu, 29 Jan 2015 13:37:32 -0800 Subject: 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 --- qt-ui/profile/diveprofileitem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'qt-ui') 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; -- cgit v1.2.3-70-g09d2