diff options
-rw-r--r-- | core/libdivecomputer.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/libdivecomputer.c b/core/libdivecomputer.c index f76a654d4..7eea60393 100644 --- a/core/libdivecomputer.c +++ b/core/libdivecomputer.c @@ -498,9 +498,9 @@ static void dc_match_serial(void *_dc, const char *model, uint32_t deviceid, con if (!deviceid) return; - if (!model || strcasecmp(dc->model, model)) + if (!dc->model && (!model || strcasecmp(dc->model, model))) return; - if (!serial || strcasecmp(dc->serial, serial)) + if (!dc->serial || !serial || strcasecmp(dc->serial, serial)) return; dc->deviceid = deviceid; } |