Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReactPage.ApplyArguments throws ArgumentException with odd number of arguments #1025

Closed
ymusiychuk-lohika opened this issue Feb 21, 2017 · 3 comments

Comments

@ymusiychuk-lohika
Copy link
Contributor

ReactPage.cs, both UWP and WPF:

if (args.Length % 2 != 0)
{
    throw new ArgumentException("Expected even number of arguments.", nameof(arguments));
}

var index = Array.IndexOf(args, "remoteDebugging");
var isRemoteDebuggingEnabled = default(bool);
if (index % 2 == 0 && bool.TryParse(args[index + 1], out isRemoteDebuggingEnabled))
{
    _reactInstanceManager.DevSupportManager.IsRemoteDebuggingEnabled = isRemoteDebuggingEnabled;
}

Shouldn't this check be made optional (only when "remoteDebugging" is found) or omitted at all?
Currently running application with single parameter like "--first-start" crashes the app.
Adding second parameter "--first --start" works fine

@matthargett
Copy link
Contributor

It looks like it wants each argument to be a key and value: --start 0 --end 2

@ymusiychuk-lohika
Copy link
Contributor Author

PR: #1028

@rozele
Copy link
Collaborator

rozele commented Mar 6, 2017

This was merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants