Skip to content
Permalink
Browse files

db, bugfix: crash in mongodb.

  • Loading branch information...
xicilion committed Sep 29, 2018
1 parent 9be8689 commit 17100aa1c932c6e9114f286607a1448a9802fc85
Showing with 3 additions and 3 deletions.
  1. +3 −3 fibjs/src/db/mongo/MongoCursor.cpp
@@ -155,7 +155,7 @@ result_t MongoCursor::forEach(v8::Local<v8::Function> func)
v8::Local<v8::Object> o;
Isolate* isolate = holder();

while ((hr = next(o)) != CALL_RETURN_NULL) {
while ((hr = next(o)) != CALL_RETURN_NULL && hr >= 0) {
v8::Local<v8::Value> a = o;
v8::Local<v8::Value> v = func->Call(v8::Undefined(isolate->m_isolate), 1, &a);

@@ -175,7 +175,7 @@ result_t MongoCursor::map(v8::Local<v8::Function> func,
v8::Local<v8::Array> as = v8::Array::New(isolate->m_isolate);
int32_t n = 0;

while ((hr = next(o)) != CALL_RETURN_NULL) {
while ((hr = next(o)) != CALL_RETURN_NULL && hr >= 0) {
v8::Local<v8::Value> a = o;
v8::Local<v8::Value> v = func->Call(v8::Undefined(isolate->m_isolate), 1, &a);

@@ -278,7 +278,7 @@ result_t MongoCursor::toArray(v8::Local<v8::Array>& retVal)
v8::Local<v8::Array> as = v8::Array::New(holder()->m_isolate);
int32_t n = 0;

while ((hr = next(o)) != CALL_RETURN_NULL) {
while ((hr = next(o)) != CALL_RETURN_NULL && hr >= 0) {
as->Set(n, o);
n++;
}

0 comments on commit 17100aa

Please sign in to comment.
You can’t perform that action at this time.