Why does this code not compile?
It gives me the error:
not all code paths return a value
Code:
public bool isUserProfileHashed(string username)
{
bool isHashed = false;
MembershipUser u = null;
u = Membership.GetUser(username);
if (u != null)
{
try
{
u.GetPassword();
}
catch (Exception exception)
{
// An exception is thrown when the GetPassword method is called for a user with a hashed password
isHashed = true;
return isHashed;
}
return isHashed;
}