Skip to content

Commit

Permalink
potential fix for #120
Browse files Browse the repository at this point in the history
  • Loading branch information
ekarak committed Sep 20, 2016
1 parent cd20793 commit e3bf533
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/openzwave-nodes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ namespace OZW {
uint8 nodeid = info[0]->ToNumber()->Value();
uint8 numNeighbors = OpenZWave::Manager::Get()->GetNodeNeighbors(homeid, nodeid, &neighbors);
Local<Array> o_neighbors = Nan::New<Array>(numNeighbors);

for (uint8 nr = 0; nr < numNeighbors; nr++) {
o_neighbors->Set(Nan::New<Integer>(nr), Nan::New<Integer>(neighbors[nr]));
if (numNeighbors > 0) {
for (uint8 nr = 0; nr < numNeighbors; nr++) {
o_neighbors->Set(Nan::New<Integer>(nr), Nan::New<Integer>(neighbors[nr]));
}
delete neighbors;
}
delete[] neighbors;

info.GetReturnValue().Set( o_neighbors );
}

Expand Down

0 comments on commit e3bf533

Please sign in to comment.