rhinocommon icon indicating copy to clipboard operation
rhinocommon copied to clipboard

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

Open sbaer opened this issue 12 years ago • 0 comments

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; }

sbaer avatar Jan 28 '13 20:01 sbaer