Skip to content
Prev Previous commit
fs: remove unnecessary throw on fs.mkdtemp
The type is already checked in JS. Change to a CHECK
  • Loading branch information
jasnell committed Nov 27, 2017
commit 4f749173f247ee0a06842ab49c27526b468ede10
3 changes: 1 addition & 2 deletions src/node_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1367,8 +1367,7 @@ static void Mkdtemp(const FunctionCallbackInfo<Value>& args) {
CHECK_GE(args.Length(), 2);

BufferValue tmpl(env->isolate(), args[0]);
if (*tmpl == nullptr)
return TYPE_ERROR("template must be a string or Buffer");
CHECK_NE(*tmpl, nullptr);

const enum encoding encoding = ParseEncoding(env->isolate(), args[1], UTF8);

Expand Down