Skip to content

Commit 036fe4e

Browse files
fix(runtime): read no inspector flags from a nil Arguments array
Config.Arguments is optional, but ArgumentsCount was handed to the inspector as is, so a nil array with a count above one made debug startup index a null argv. Pass a count of 0 when the array is nil; the argv loop keeps the C contract and trusts the count it is given.
1 parent d02c8e4 commit 036fe4e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎NativeScript/NativeScript.mm‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,9 @@ - (instancetype)initializeWithConfig:(Config*)config {
184184
new v8_inspector::JsV8InspectorClient(runtime_.get());
185185
inspectorClient->init();
186186
inspectorClient->registerModules();
187-
inspectorClient->connect([config ArgumentsCount], [config Arguments]);
187+
// A nil Arguments array carries no inspector flags, whatever ArgumentsCount says.
188+
inspectorClient->connect(config.Arguments != nullptr ? config.ArgumentsCount : 0,
189+
config.Arguments);
188190
Console::AttachInspectorClient(inspectorClient);
189191
}
190192
}

0 commit comments

Comments
 (0)