mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-01 03:13:24 +00:00
downloader: check for parsing failure
Don't continue if the dive log could not be loaded. Otherwise we end up writing out an empty dive log. Signed-off-by: Richard Fuchs <dfx@dfx.at>
This commit is contained in:
parent
0ee5c8f03a
commit
1952d1c187
1 changed files with 4 additions and 1 deletions
|
@ -91,7 +91,10 @@ int main(int argc, char **argv)
|
||||||
filesOnCommandLine = !files.isEmpty() || !importedFiles.isEmpty();
|
filesOnCommandLine = !files.isEmpty() || !importedFiles.isEmpty();
|
||||||
if (!files.isEmpty()) {
|
if (!files.isEmpty()) {
|
||||||
qDebug() << "loading dive data from" << files;
|
qDebug() << "loading dive data from" << files;
|
||||||
parse_file(qPrintable(files.first()), &divelog);
|
if (parse_file(qPrintable(files.first()), &divelog) < 0) {
|
||||||
|
printf("Failed to load dives from file '%s', aborting.\n", qPrintable(files.first()));
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
print_files();
|
print_files();
|
||||||
if (!quit) {
|
if (!quit) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue