logo
Welcome to our new AbleCommerce forums. As a guest, you may view the information here. To post to this forum, you must have a registered account with us, either as a new user evaluating AbleCommerce or an existing user of the application. For all questions related to the older version of Gold and earlier, please go to AbleCommerce Gold forum. Please use your AbleCommerce username and password to Login. New Registrations are disabled.

Notification

Icon
Error

Options
Go to last post Go to first unread
Joe Payne2  
#1 Posted : Wednesday, August 10, 2022 10:47:06 AM(UTC)
Joe Payne2

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

Wanna join the discussion?! Login to your AbleCommerce Forums forum account. New Registrations are disabled.

nadeem  
#2 Posted : Thursday, August 11, 2022 10:54:59 AM(UTC)
nadeem

Rank: Advanced Member

Groups: Administrators, Developers, Registered, HelpDesk, Authorized User, Admin, System
Joined: 10/11/2018(UTC)
Posts: 109

Thanks: 17 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!
thanks 1 user thanked nadeem for this useful post.
Joe Payne2 on 8/11/2022(UTC)
Users browsing this topic
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.