File tree 1 file changed +5
-3
lines changed
generate/templates/templates 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -69,9 +69,10 @@ void LockMasterSetStatus(const FunctionCallbackInfo<Value>& info) {
69
69
Nan::HandleScope scope;
70
70
71
71
// convert the first argument to Status
72
- if (info.Length () >= 0 && info[0 ]->IsNumber ()) {
73
- v8::Local<v8::Int32> value = info[0 ]->ToInt32 ();
74
- LockMaster::Status status = static_cast <LockMaster::Status>(value->Value ());
72
+ if (info.Length () >= 0 && info[0 ]->IsUint32 ()) {
73
+ uint value = info[0 ]->Uint32Value ();
74
+
75
+ LockMaster::Status status = static_cast <LockMaster::Status>(value);
75
76
if (status >= LockMaster::Disabled && status <= LockMaster::Enabled) {
76
77
LockMaster::SetStatus (status);
77
78
return ;
@@ -82,6 +83,7 @@ void LockMasterSetStatus(const FunctionCallbackInfo<Value>& info) {
82
83
Nan::ThrowError (" Argument must be one 0, 1 or 2" );
83
84
}
84
85
86
+
85
87
void LockMasterGetStatus (const FunctionCallbackInfo<Value>& info) {
86
88
info.GetReturnValue ().Set (Nan::New (LockMaster::GetStatus ()));
87
89
}
You can’t perform that action at this time.
0 commit comments