From 1d0aa6e1cd6f54b5beef526a59519a5b6b0a9735 Mon Sep 17 00:00:00 2001 From: Devendra Satram Date: Sat, 20 Apr 2019 23:44:04 +0530 Subject: [PATCH] src: refactor RealEnvStore methods - review comments fixing - 2a Removed exception throwing if value is empty, since the same is handled in caller and returned immediately. Fixes: https://github.com/nodejs/node/issues/27211 Refs: https://github.com/nodejs/node/pull/27310#discussion_r277063377 --- src/node_env_var.cc | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/node_env_var.cc b/src/node_env_var.cc index 61c481948fe524..5ac44646c6603f 100644 --- a/src/node_env_var.cc +++ b/src/node_env_var.cc @@ -98,14 +98,6 @@ MaybeLocal RealEnvStore::Get(Isolate* isolate, if (ret >= 0) { // Env key value fetch success. MaybeLocal value_string = String::NewFromUtf8(isolate, *val, NewStringType::kNormal, init_sz); - - // If fetched value is empty, raise exception - // and return empty handle. - if (value_string.IsEmpty()) { - Environment::GetCurrent(isolate)->ThrowUVException(ret, "getenv"); - return MaybeLocal(); - } - return value_string; }