Check first the value of username if it isn't null.
if(!String.IsNullOrEmpty(username))
{
Response.Redirect("administrator.aspx?uid=" + username);
}
else
{
//do not redirect
}
Please mark as answer and vote 5 if this solved your problem
Regards,
Eduard