raven.api.chat.get_channel_members built each Open-channel member's row by
indexing straight into the Raven User lookup result without checking it was
found, unlike the identical branch 10 lines below for non-Open channels. A
workspace member whose Raven User record is missing (e.g. left behind by a
direct cleanup that skipped RavenUser.on_trash's own cascade) crashes the
whole whitelisted endpoint with AttributeError instead of just being omitted.
Extracted the row-building into build_member_entry(), which returns None for
an unmatched member so both branches skip it the same way. Added
raven/tests/test_chat_channel_members.py (pure-function coverage plus an
IntegrationTestCase reproducing the stale-membership state) following this
repo's existing test conventions.
Verified: apps/web vitest (480/480) and tsc -b are unaffected and pass; the
new Python tests need a Frappe bench (DB-backed test runner) this sandbox
does not have, so they are written to the repo's established
IntegrationTestCase pattern but not executed here.