This patch both fixes the query (fixing the case where the archived filter is null) and adds error handling so the fatal error can't happen again (see the part in contact model) even if we manage to reintroduce this bug and instead adds a happy error message.
Testing Instructions
Create a contact in the frontend and try and submit a contact. Before you get a fatal error in JRegistry. After patch contact submission successfully sends.
@wilsonge as you already are on it, can you fix my prevoius mistake from #24965 on
joomla-cms/components/com_contact/Model/ContactModel.php
Line 352 in 0fd4c87
from
$query->whereIn($db->quoteName('a.language'), $language);
to
$query->whereIn($db->quoteName('a.language'), $language, ParameterType::STRING);