mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Fix crash if we have no divecomputer information
The string we print is lame, but it keeps things consistent (and prevents us from dereferencing functions in uninitialized objects). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
5105d6a333
commit
d62d1124cf
1 changed files with 5 additions and 4 deletions
|
@ -311,10 +311,11 @@ void ProfileGraphicsView::plot(struct dive *d)
|
|||
if (nick.isEmpty())
|
||||
nick = QString(dc->model);
|
||||
|
||||
if (!nick.isEmpty()) {
|
||||
text_render_options_t computer = {DC_TEXT_SIZE, TIME_TEXT, LEFT, MIDDLE};
|
||||
diveComputer = plot_text(&computer, QPointF(gc.leftx, gc.bottomy), nick);
|
||||
}
|
||||
if (nick.isEmpty())
|
||||
nick = tr("unknown divecomputer");
|
||||
|
||||
text_render_options_t computer = {DC_TEXT_SIZE, TIME_TEXT, LEFT, MIDDLE};
|
||||
diveComputer = plot_text(&computer, QPointF(gc.leftx, gc.bottomy), nick);
|
||||
// The Time ruler should be right after the DiveComputer:
|
||||
timeMarkers->setPos(0, diveComputer->y());
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue