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:
Dirk Hohndel 2013-10-09 00:15:46 -07:00
parent 7f4e4b16ed
commit c74b286e70

View file

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