[Room] Add missing null check

This commit is contained in:
Christian Pauly 2019-11-29 12:14:59 +00:00
parent 2a17d67f1b
commit fe0dac62c9
1 changed files with 1 additions and 1 deletions

View File

@ -203,7 +203,7 @@ class Room {
!canonicalAlias.isEmpty &&
canonicalAlias.length > 3)
return canonicalAlias.substring(1, canonicalAlias.length).split(":")[0];
if (mHeroes.length > 0 && mHeroes.any((h) => h.isNotEmpty)) {
if (mHeroes != null && mHeroes.length > 0 && mHeroes.any((h) => h.isNotEmpty)) {
String displayname = "";
for (int i = 0; i < mHeroes.length; i++) {
if (mHeroes[i].isEmpty) continue;