Validate log list after loading it
This commit is contained in:
parent
6d5e2395a1
commit
74a7329c00
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue