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:
parent
962e71d495
commit
4e40872fc0
@ -572,7 +572,7 @@ DiveMeanDepthItem::DiveMeanDepthItem()
|
|||||||
|
|
||||||
void DiveMeanDepthItem::modelDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
|
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.
|
// We don't have enougth data to calculate things, quit.
|
||||||
if (!shouldCalculateStuff(topLeft, bottomRight))
|
if (!shouldCalculateStuff(topLeft, bottomRight))
|
||||||
return;
|
return;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user