◐ Shell
clean mode source ↗

src: fix order of CHECK_NOT_NULL/dereference · nodejs/node@716750f

Original file line numberDiff line numberDiff line change

@@ -1565,12 +1565,12 @@ static void Unlink(const FunctionCallbackInfo<Value>& args) {

15651565
15661566

if (argc > 1) { // unlink(path, req)

15671567

FSReqBase* req_wrap_async = GetReqWrap(args, 1);

1568+

CHECK_NOT_NULL(req_wrap_async);

15681569

ASYNC_THROW_IF_INSUFFICIENT_PERMISSIONS(

15691570

env,

15701571

req_wrap_async,

15711572

permission::PermissionScope::kFileSystemWrite,

15721573

path.ToStringView());

1573-

CHECK_NOT_NULL(req_wrap_async);

15741574

FS_ASYNC_TRACE_BEGIN1(

15751575

UV_FS_UNLINK, req_wrap_async, "path", TRACE_STR_COPY(*path))

15761576

AsyncCall(env, req_wrap_async, args, "unlink", UTF8, AfterNoArgs,