Protected the query for the realm_content_type with a try/except.