Skip to content
This repository was archived by the owner on Dec 1, 2024. It is now read-only.

Commit 7312cbb

Browse files
authored
Throw error in iterator_seek if iterator has ended (#618)
1 parent 31b66cf commit 7312cbb

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

binding.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1367,6 +1367,10 @@ NAPI_METHOD(iterator_seek) {
13671367
NAPI_ARGV(2);
13681368
NAPI_ITERATOR_CONTEXT();
13691369

1370+
if (iterator->ended_) {
1371+
napi_throw_error(env, NULL, "iterator has ended");
1372+
}
1373+
13701374
iterator->ReleaseTarget();
13711375
iterator->target_ = new leveldb::Slice(ToSlice(env, argv[1]));
13721376
iterator->GetIterator();

0 commit comments

Comments
 (0)