From cbe8c2a4c90cb0472e265f8cb02a5ac953062731 Mon Sep 17 00:00:00 2001 From: brettlangdon Date: Sat, 2 Nov 2013 10:17:49 -0400 Subject: [PATCH] fix bug in firstRecord when there are no records --- src/wgdb.cc | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/wgdb.cc b/src/wgdb.cc index 5a58797..fbc17d9 100644 --- a/src/wgdb.cc +++ b/src/wgdb.cc @@ -195,12 +195,6 @@ void do_first_record(uv_work_t* req){ baton->error = buffer; return; } - if(data->record == NULL){ - char buffer[1024]; - sprintf(buffer, "wgdb database %s could not create record of length %d", baton->wgdb->db_name, data->length); - baton->error = buffer; - return; - } baton->data = data; } @@ -511,7 +505,7 @@ void Record::do_after_create_record(uv_work_t* req, int status){ Baton* baton = static_cast(req->data); RecordData* data = static_cast(baton->data); Local result; - if(!baton->error && data->record){ + if(!baton->error && data->record != NULL){ Local record_obj = Record::constructor->NewInstance(0, NULL); Record* record = ObjectWrap::Unwrap(record_obj); record->rec_ptr = data->record;