Fix missing assignment to `err` variable

Fixes a nil pointer dereference in the case that json.Unmarshal fails.