Hi,
I'm having a weird error. During user creation, if a username already exists in the system, I do a few checks on it and allow the user to sign up again if the existing account is not activated yet. I'm getting an error that says:
[NullReferenceException: Object reference not set to an instance of an object.]
LAUNCHOnline.en.ca.CreateUser.wCreateUser_Error(Object sender, CreateUserErrorEventArgs e) in C:\Projects\LAUNCH\LAUNCH-Online\LAUNCHOnline\en\ca\CreateUser.aspx.cs:194
My Code: (var vUser is the line causing the error)
protected void wCreateUser_Error(object sender, CreateUserErrorEventArgs e)
{
// TODO: more verbose error messages.
if (e.CreateUserError == MembershipCreateStatus.DuplicateEmail)
{
// WORK IN PROGRESS
// If the user is not activated yet, update the existing user info with the new info
// as it might be a feedback user. Else, give an error.
// Get the user from the database.
var vUser = (from u in this.dcLAUNCHOnline.aspnet_Users
where u.UserName.Equals(this.wCreateUser.UserName)
select u).Single();
Note: The user's username is just their email. I manually checked, and people who are getting this error do have an account in the database already, but still get this error. The case of the username didn't cause the problem, as I tried different cases with temp accounts and it worked fine.
Any Help appreciated - thanks!