in the original code the member.getUserid() is checked but never assigned to the memberId variable, causing the exception down below to be raised.