Corrected shared/error_messages partial - now it checks if passed object isn't nil