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>
This commit is contained in:
Dirk Hohndel 2015-01-29 13:37:32 -08:00
parent 962e71d495
commit 4e40872fc0

View file

@ -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;