1

Resolved

PropertyCommand - Length cannot be less than zero error.

description

If an index object has more than 1 period in it, it will produce an error stating that the parameter Length cannot be less than zero.
Changing the following if statement into a while loop fixes the issue. (PropertyCommand.cs line 197 in change set 28470)
 
if (delimiterIndex > propertyPath.IndexOf("[") &&
delimiterIndex < propertyPath.IndexOf("]"))
{
delimiterIndex = propertyPath.IndexOf(".", delimiterIndex + 1 );
}

comments

johnwelch wrote Mar 2, 2009 at 4:27 PM

Can you provide an example path that causes this error? I have several test scenarios that include multiple periods that run successfully, and I can't duplicate the error.

I don't doubt that it's happening, just want to be able to repro it to ensure I'm fixing the right thing.

jsearcy wrote Mar 3, 2009 at 4:25 PM

The instance I encountered it was similar to this:

Package.Connections[ftp.mydomain.com].Properties[someproperty]

The second substring was resulting in "Connections[ftp.mydomain" rather than "Connections[ftp.mydomain.com]", because of the second period in the index name. Hope that helps.

wrote Mar 27, 2009 at 3:19 AM

Associated with changeset 30364.

johnwelch wrote Mar 27, 2009 at 6:49 PM

Ended up fixing by leaving the if but changing the next line to look for the next period after the closing bracket. That way, it saves looping through all the periods.