Skip to content

Commit eb18a1f

Browse files
committed
Test fix for node 0.8 failing.
This was suggested by someone. Just checking it out.
1 parent a027809 commit eb18a1f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/robotjs.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -734,17 +734,17 @@ class BMP
734734
//Convert object from Javascript to a C++ class (BMP).
735735
BMP buildBMP(Local<Object> info)
736736
{
737-
Local<Object> obj = Nan::To<v8::Object>(info).ToLocalChecked();
738-
737+
char * buf = NULL;
739738
BMP img;
739+
Local<Object> obj = Nan::To<v8::Object>(info).ToLocalChecked();
740740

741741
img.width = obj->Get(Nan::New("width").ToLocalChecked())->Uint32Value();
742742
img.height = obj->Get(Nan::New("height").ToLocalChecked())->Uint32Value();
743743
img.byteWidth = obj->Get(Nan::New("byteWidth").ToLocalChecked())->Uint32Value();
744744
img.bitsPerPixel = obj->Get(Nan::New("bitsPerPixel").ToLocalChecked())->Uint32Value();
745745
img.bytesPerPixel = obj->Get(Nan::New("bytesPerPixel").ToLocalChecked())->Uint32Value();
746746

747-
char* buf = node::Buffer::Data(obj->Get(Nan::New("image").ToLocalChecked()));
747+
buf = node::Buffer::Data(obj->Get(Nan::New("image").ToLocalChecked()));
748748

749749
//Convert the buffer to a uint8_t which createMMBitmap requires.
750750
img.image = (uint8_t *)malloc(img.byteWidth * img.height);

0 commit comments

Comments
 (0)