1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-09-01 21:21:58 +03:00

Check m.room.name event actually has a name in the content before using it. This should fix the recent disasters with #android being shown as 'undefined' (or crashing vector).

This commit is contained in:
David Baker
2015-11-04 15:20:25 +00:00
parent 9cf7edc48d
commit bc512a6e4c

View File

@@ -438,7 +438,7 @@ function calculateRoomName(room, userId) {
// check for an alias, if any. for now, assume first alias is the
// official one.
var mRoomName = room.currentState.getStateEvents("m.room.name", "");
if (mRoomName) {
if (mRoomName && mRoomName.getContent() && mRoomName.getContent().name) {
return mRoomName.getContent().name;
}