Skip to content

Commit

Permalink
Handle case of input not being set
Browse files Browse the repository at this point in the history
  • Loading branch information
hellais committed Jan 11, 2021
1 parent 6a1751d commit 581f87c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/database/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ func GetMeasurementJSON(sess sqlbuilder.Database, measurementID int64) (map[stri
if measurement.IsUploaded {
reportID := measurement.Measurement.ReportID.String
url := measurement.URL.URL.String
measurementURL := fmt.Sprintf("https://api.ooni.io/api/v1/raw_measurement?report_id=%s&input=%s", reportID, url)
measurementURL := fmt.Sprintf("https://api.ooni.io/api/v1/raw_measurement?report_id=%s", reportID)
if url != "" {
measurementURL += "&input=" + url
}
resp, err := http.Get(measurementURL)
if err != nil {
log.Errorf("failed to fetch the measurement %s %s", reportID, url)
Expand Down

0 comments on commit 581f87c

Please sign in to comment.