We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5c3bc7b commit deb8c53Copy full SHA for deb8c53
src/canWrapper.cc
@@ -676,7 +676,7 @@ Napi::Promise writeDfuToBin(const Napi::CallbackInfo& info) {
676
std::string binFileName = info[1].As<Napi::String>().Utf8Value();
677
int elementIndex;
678
679
- if(info[2].IsUndefined()) {
+ if(info[2].IsUndefined() || info[2].IsNull()) {
680
elementIndex = 0;
681
} else {
682
elementIndex = info[2].As<Napi::Number>().Int32Value();
0 commit comments