diff --git a/lib/internal/process/main_thread_only.js b/lib/internal/process/main_thread_only.js index 96c57fda35c755..2572402f620c27 100644 --- a/lib/internal/process/main_thread_only.js +++ b/lib/internal/process/main_thread_only.js @@ -26,11 +26,9 @@ function wrapProcessMethods(binding) { } function umask(mask) { - if (mask === undefined) { - // Get the mask - return binding.umask(mask); + if (mask !== undefined) { + mask = validateMode(mask, 'mask'); } - mask = validateMode(mask, 'mask'); return binding.umask(mask); }