Skip to content

Commit

Permalink
Return an error from ListPointers for broken JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
dustin committed Aug 9, 2014
1 parent 3ffac56 commit 63fc374
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bytes.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ func ListPointers(data []byte) ([]string, error) {
current = sliceToEnd(current)
case json.ScanBeginObject:
current = append(current, "")
case json.ScanError:
return nil, fmt.Errorf("Error reading JSON object at offset %v", offset)
}

if newOp == json.ScanBeginArray || newOp == json.ScanArrayValue ||
Expand Down

0 comments on commit 63fc374

Please sign in to comment.