Skip to content
This repository has been archived by the owner on Dec 23, 2020. It is now read-only.

Settings.GetStringList not returning default value when no key is found #127

Open
sbaer opened this issue Jan 28, 2013 · 0 comments
Open
Assignees
Labels

Comments

@sbaer
Copy link
Member

sbaer commented Jan 28, 2013

From Menno on plug-ins newsgroup

If I run the code below, the returned value is null. I expected it to be an
empty array.

protected override Result RunCommand(RhinoDoc doc, RunMode mode)
{
String[] defaultValue = new string[0];
String[] result = Settings.GetStringList("NO_KEY", defaultValue);
if (null == result)
RhinoApp.WriteLine("Result is null"); //unexpected
else
{
RhinoApp.WriteLine("Result length: {0}",result.Length); // expected
output length => 0
}
return Result.Success;
}

@ghost ghost assigned sbaer Jan 28, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant