mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-01 02:53:24 +00:00
Downloader: fix segfault
With no files given and no config present, the downloader segfaults due to empty `files`. Print a message instead. Signed-off-by: Richard Fuchs <dfx@dfx.at>
This commit is contained in:
parent
05ef933ff7
commit
e00e1bb9f7
1 changed files with 8 additions and 1 deletions
|
@ -102,7 +102,14 @@ int main(int argc, char **argv)
|
||||||
cliDownloader(prefs.dive_computer.vendor, prefs.dive_computer.product, prefs.dive_computer.device);
|
cliDownloader(prefs.dive_computer.vendor, prefs.dive_computer.product, prefs.dive_computer.device);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!files.isEmpty()) {
|
||||||
|
qDebug() << "saving dive data to" << files;
|
||||||
save_dives(qPrintable(files.first()));
|
save_dives(qPrintable(files.first()));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
printf("No log files given, not saving dive data.\n");
|
||||||
|
printf("Give a log file name as argument, or configure a cloud URL.\n");
|
||||||
|
}
|
||||||
clear_divelog(&divelog);
|
clear_divelog(&divelog);
|
||||||
taglist_free(g_tag_list);
|
taglist_free(g_tag_list);
|
||||||
parse_xml_exit();
|
parse_xml_exit();
|
||||||
|
|
Loading…
Add table
Reference in a new issue