Skip to content

Commit 6c702ce

Browse files
committed
fix #264 check io.EOF when test decoder.More
1 parent f88871b commit 6c702ce

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

adapter.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,14 @@ func (adapter *Decoder) Decode(obj interface{}) error {
7777

7878
// More is there more?
7979
func (adapter *Decoder) More() bool {
80-
if adapter.iter.head != adapter.iter.tail {
80+
iter := adapter.iter
81+
if iter.Error != nil {
82+
return false
83+
}
84+
if iter.head != iter.tail {
8185
return true
8286
}
83-
return adapter.iter.loadMore()
87+
return iter.loadMore()
8488
}
8589

8690
// Buffered remaining buffer

0 commit comments

Comments
 (0)