mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 22:35:27 +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();
|
||||
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…
Add table
Reference in a new issue