File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Open diff view settings
Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Open diff view settings
Original file line number Diff line number Diff line change @@ -570,6 +570,8 @@ void StringSlice(const FunctionCallbackInfo<Value>& args) {
570570void DecodeUTF8 (const FunctionCallbackInfo<Value>& args) {
571571 Environment* env = Environment::GetCurrent (args); // list, flags
572572
573+ CHECK_GE (args.Length (), 1 );
574+
573575 if (!(args[0 ]->IsArrayBuffer () || args[0 ]->IsSharedArrayBuffer () ||
574576 args[0 ]->IsArrayBufferView ())) {
575577 return node::THROW_ERR_INVALID_ARG_TYPE (
@@ -580,7 +582,6 @@ void DecodeUTF8(const FunctionCallbackInfo<Value>& args) {
580582
581583 ArrayBufferViewContents<char > buffer (args[0 ]);
582584
583- CHECK (args[1 ]->IsBoolean ());
584585 bool ignore_bom = args[1 ]->IsTrue ();
585586
586587 const char * data = buffer.data ();
You can’t perform that action at this time.
0 commit comments