From 52332c09772123a69c93c32945f04e5e5604fe78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arturo=20Filast=C3=B2?= Date: Wed, 29 Jan 2020 18:48:12 +0100 Subject: [PATCH] Changes based on feedback from @bassosimone --- build.sh | 4 ++-- internal/database/actions.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build.sh b/build.sh index 4b107d2..e7aaafe 100755 --- a/build.sh +++ b/build.sh @@ -1,10 +1,10 @@ -#!/bin/sh +#!/bin/bash set -e buildtags="" ldflags="-s -w" -if [ "$1" = "bindata" ];then +if [ "$1" = "bindata" ]; then GO_BINDATA_V=$(go-bindata -version | grep go-bin | cut -d ' ' -f2) [[ "$GO_BINDATA_V" == "3.2.0" ]] && echo "Updating bindata" || exit "Wrong go-bindata-version" go-bindata -nometadata -o internal/bindata/bindata.go -pkg bindata data/... diff --git a/internal/database/actions.go b/internal/database/actions.go index 4f71173..074c4bf 100644 --- a/internal/database/actions.go +++ b/internal/database/actions.go @@ -55,14 +55,14 @@ func GetMeasurementJSON(sess sqlbuilder.Database, measurementID int64) (map[stri log.Errorf("failed to run query %s: %v", req.String(), err) return nil, err } + // MeasurementFilePath might be NULL because the measurement from a + // 3.0.0-beta install 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 b, err := ioutil.ReadFile(measurementFilePath) if err != nil { return nil, err