Handle the case when we try to access an old measurement

This commit is contained in:
Arturo Filastò 2020-01-29 10:43:08 +01:00
parent e38d42d33a
commit 4711a76c11

View File

@ -55,6 +55,11 @@ func GetMeasurementJSON(sess sqlbuilder.Database, measurementID int64) (map[stri
log.Errorf("failed to run query %s: %v", req.String(), err)
return nil, err
}
if measurement.Measurement.MeasurementFilePath.Valid == false {
log.Error("invalid measurement_file_path")
log.Error("backup your OONI_HOME and run `ooniprobe reset`")
return nil, errors.New("cannot access measurement file")
}
measurementFilePath := measurement.Measurement.MeasurementFilePath.String
// TODO handle the case in which we have MeasurementFilePath == NULL because
// it's a beta measurement