mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Make sure the model is non-NULL before comparing with it
In commit 194a05b18911 "Correct the detection of existing dives in the Uemis downloader" I forgot to add that check before calling strcmp. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
e862f7c343
commit
7aaa539afe
1 changed files with 1 additions and 1 deletions
|
@ -733,7 +733,7 @@ static char *get_divenr(char *deviceidstr)
|
|||
for (i = 0; i < dive_table.nr; i++) {
|
||||
struct divecomputer *dc = &dive_table.dives[i]->dc;
|
||||
while (dc) {
|
||||
if (!strcmp(dc->model, "Uemis Zurich") &&
|
||||
if (dc->model && !strcmp(dc->model, "Uemis Zurich") &&
|
||||
dc->deviceid == deviceid && dc->diveid > maxdiveid)
|
||||
maxdiveid = dc->diveid;
|
||||
dc = dc->next;
|
||||
|
|
Loading…
Reference in a new issue