MySQL server has gone away

Call to a member function getMLSInfoByAgCodeForTM() on null