Validate log list after loading it

This commit is contained in:
Andrew Ayer 2020-05-01 16:05:37 -04:00
parent 6d5e2395a1
commit 74a7329c00
1 changed files with 3 additions and 0 deletions

View File

@ -54,5 +54,8 @@ func unmarshal(jsonBytes []byte) (*List, error) {
if err := json.Unmarshal(jsonBytes, list); err != nil {
return nil, err
}
if err := list.Validate(); err != nil {
return nil, fmt.Errorf("Invalid log list: %s", err)
}
return list, nil
}