bugfix , make sure we have positions before trying to access it

This commit is contained in:
Lovisa Hassler
2018-12-14 11:37:24 -05:00
parent 182fd8253f
commit 3d4114247f
2 changed files with 4 additions and 3 deletions

View File

@@ -56,7 +56,8 @@ namespace openspace {
int idx = DataFileHelper::findFileIndexForCurrentTime(time, timeDoubles);
updateRadecData(idx);
}
if(!correctMinute(time)) {
// positions have to be loaded before we try to update minute
if(positions.size() && !correctMinute(time)) {
//Compensate for light travel time to the spacecraft
int idx = DataFileHelper::findFileIndexForCurrentTime(time, minuteTimes);

View File

@@ -49,7 +49,7 @@ namespace openspace {
mutable std::vector<double> minuteTimes;
mutable Position position;
mutable double activeMinute;
mutable double activeMinute = -1;
/* Identifier for object using the translation, used for logging */
std::string objectIdentifier;
/*Used to check if the loaded file is still relevant or if we should look for another one. */
@@ -79,4 +79,4 @@ namespace openspace {
};
}
#endif
#endif // __OPENSPACE_MODULE_DSN___RADECMANAGER___H__