Merge pull request #203 from kortschak/defensive
Make graph.Delta zero state invalid for use
This commit is contained in:
commit
327b6aac49
5 changed files with 20 additions and 5 deletions
|
|
@ -185,6 +185,9 @@ func (qs *QuadStore) ApplyDeltas(deltas []graph.Delta) error {
|
|||
resizeMap := make(map[string]int64)
|
||||
sizeChange := int64(0)
|
||||
for _, d := range deltas {
|
||||
if d.Action != graph.Add && d.Action != graph.Delete {
|
||||
return errors.New("leveldb: invalid action")
|
||||
}
|
||||
bytes, err := json.Marshal(d)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue