Fix scope for strings reading app options

This commit is contained in:
Alex Hultman 2019-12-10 15:12:34 +01:00 committed by GitHub
parent fef9cf27b1
commit e45994a9d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -261,16 +261,11 @@ void uWS_App(const FunctionCallbackInfo<Value> &args) {
/* Read the options object if any */
us_socket_context_options_t options = {};
std::string keyFileName, certFileName, passphrase, dhParamsFileName, caFileName;
if (args.Length() == 1) {
Local<Object> optionsObject = Local<Object>::Cast(args[0]);
std::string keyFileName;
std::string certFileName;
std::string passphrase;
std::string dhParamsFileName;
std::string caFileName;
/* Key file name */
NativeString keyFileNameValue(isolate, optionsObject->Get(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "key_file_name", NewStringType::kNormal).ToLocalChecked()).ToLocalChecked());
if (keyFileNameValue.isInvalid(args)) {