mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-20 06:45:27 +00:00
Fix potential uninitialized variable
Most of the "possibly unitialized" warnings are bogus, but this one is a potential real bug. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
7f4e4b16ed
commit
c74b286e70
1 changed files with 2 additions and 2 deletions
|
@ -217,7 +217,7 @@ QColor ProfileGraphicsView::getColor(const color_indice_t i)
|
|||
|
||||
void ProfileGraphicsView::plot(struct dive *d, bool forceRedraw)
|
||||
{
|
||||
struct divecomputer *dc;
|
||||
struct divecomputer *dc = NULL;
|
||||
|
||||
if (d)
|
||||
dc = select_dc(&d->dc);
|
||||
|
@ -247,7 +247,7 @@ void ProfileGraphicsView::plot(struct dive *d, bool forceRedraw)
|
|||
// Fix this for printing / screen later.
|
||||
// plot_set_scale(scale_mode_t);
|
||||
|
||||
if (!dc->samples) {
|
||||
if (!dc || !dc->samples) {
|
||||
dc = fake_dc(dc);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue