Fix right panel hiding when viewing room member

If you clicked on the header button whilst the right panel was
showing a room member, it would NPE because there was no
refireParams.member. It fires the same phase with no refireParams to
toggle the panel visibility (apparently), so detect that case.

Fixes https://github.com/vector-im/riot-web/issues/13571
This commit is contained in:
David Baker 2020-05-07 09:43:14 +01:00
parent 7f030a149e
commit 0b5691c003

View file

@ -139,7 +139,7 @@ export default class RightPanelStore extends Store {
let targetPhase = payload.phase; let targetPhase = payload.phase;
let refireParams = payload.refireParams; let refireParams = payload.refireParams;
// redirect to EncryptionPanel if there is an ongoing verification request // redirect to EncryptionPanel if there is an ongoing verification request
if (targetPhase === RIGHT_PANEL_PHASES.RoomMemberInfo) { if (targetPhase === RIGHT_PANEL_PHASES.RoomMemberInfo && payload.refireParams) {
const {member} = payload.refireParams; const {member} = payload.refireParams;
const pendingRequest = pendingVerificationRequestForUser(member); const pendingRequest = pendingVerificationRequestForUser(member);
if (pendingRequest) { if (pendingRequest) {