Rank: Advanced Member
Groups: HelpDesk, Developers Joined: 11/9/2018(UTC) Posts: 564
Thanks: 122 times Was thanked: 26 time(s) in 25 post(s)
|
The property FullName set{} method does not gracefully handle an empty value passed to it when defining a new Address() object. The value.IndexOf(" ") throws a null object reference error. Code:
set
{
int firstSpace = value.IndexOf(" ");
if (firstSpace > -1)
{
this.FirstName = value.Substring(0, firstSpace);
this.LastName = value.Substring(firstSpace + 1);
}
else this.FirstName = value;
}
|
|
|
|
Rank: Advanced Member
Groups: Administrators, Developers, Registered, HelpDesk, Authorized User, Admin, System Joined: 10/11/2018(UTC) Posts: 110
Thanks: 19 times Was thanked: 18 time(s) in 18 post(s)
|
Yes, the code needs to be improved to handle the null exception caused by the empty value as you described. I have logged this to be looked into for a future version. Thanks for pointing this out!
|
1 user thanked nadeem for this useful post.
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The AbleCommerce Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close