Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • progproger 49 posts 106 karma points
    Jan 25, 2016 @ 09:31
    progproger
    0

    EnsureCustomerCreationAndConvertBasket Error On Preview

    Hi,

    I'm using Umbraco 7.3.1 , Merchello 1.13.1.1 and Bazaar. I'm getting an error when trying to preview the page from backoffice.

    Object reference not set to an instance of an object.

    protected override void EnsureCustomerCreationAndConvertBasket(ICustomerBase customer)
            {
                if (!customer.IsAnonymous)
                    return;
    
                var memberId = Convert.ToInt32(this.MembershipProviderKey(customer.Key));
                var member = _memberService.GetById(memberId);
    
                    if (MerchelloConfiguration.Current.CustomerMemberTypes.Any(x => x == member.ContentTypeAlias))
                    {
                        base.EnsureCustomerCreationAndConvertBasket(customer);
                    }
            }
    

    This error occurs only when i have not logged in into bazaar system... In this case "member" object is null... After that i also get this error without previewing the page. I deleted cookies and it worked, but i still can't preview as it calls "EnsureCustomerCreationAndConvertBasket" method. What if i check "member" object for null???

Please Sign in or register to post replies

Write your reply to:

Draft