Fix crash opening testdive0.xml
That particular dive didn't have a temperature, and thus we got a crash while accessing the last temperature text. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
191a3064a7
commit
021d799ff9
@ -267,7 +267,8 @@ void DiveTemperatureItem::modelDataChanged(const QModelIndex& topLeft, const QMo
|
||||
((abs(last_valid_temp - last_printed_temp) > 500) || ((double)last / (double)sec < 0.75))) {
|
||||
createTextItem(sec, last_valid_temp);
|
||||
}
|
||||
texts.last()->setAlignment(Qt::AlignLeft | Qt::AlignBottom);
|
||||
if( texts.count())
|
||||
texts.last()->setAlignment(Qt::AlignLeft | Qt::AlignBottom);
|
||||
}
|
||||
|
||||
void DiveTemperatureItem::createTextItem(int sec, int mkelvin)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user