mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-03 18:19:38 -06:00
Gracefully deal with empty ossync files in UrlSynchronization
This commit is contained in:
@@ -210,7 +210,7 @@ bool UrlSynchronization::isEachFileValid() {
|
||||
file.close();
|
||||
createSyncFile();
|
||||
// File is valid until some date
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
// Otherwise first line is the version number.
|
||||
std::string ossyncVersion = line;
|
||||
@@ -244,6 +244,10 @@ bool UrlSynchronization::isEachFileValid() {
|
||||
// i.e. no sync needed.
|
||||
return fileValidAsJ2000 > todaysDateAsJ2000;
|
||||
}
|
||||
else if (ossyncVersion.empty()) {
|
||||
// For some reason we ended up with an empty synchronization file
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
LERROR(fmt::format(
|
||||
"{}: Unknown ossync version number read. Got {} while {} and below are valid",
|
||||
|
||||
Reference in New Issue
Block a user