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
@ -91,7 +91,10 @@ int main(int argc, char **argv)
|
||||
filesOnCommandLine = !files.isEmpty() || !importedFiles.isEmpty();
|
||||
if (!files.isEmpty()) {
|
||||
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();
|
||||
if (!quit) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user