Q: Call to member function on null - Freeform (Solspace)
Please read the article handling errors gracefully in Craft  it will explain to code defensively and what to do in those scenarios. Your $user variable is null and you can't execute functions on null variables