Skip to content

Commit

Permalink
src: refactor RealEnvStore methods - review comments fixing - 2a
Browse files Browse the repository at this point in the history
Removed exception throwing if value is empty, since the same is handled
in caller and returned immediately.

Fixes: nodejs#27211
Refs: nodejs#27310 (comment)
  • Loading branch information
devasci authored and addaleax committed Aug 20, 2019
1 parent 4d51c93 commit 1d0aa6e
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/node_env_var.cc
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,6 @@ MaybeLocal<String> RealEnvStore::Get(Isolate* isolate,
if (ret >= 0) { // Env key value fetch success.
MaybeLocal<String> 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<String>();
}

return value_string;
}

Expand Down

0 comments on commit 1d0aa6e

Please sign in to comment.