fix: No client on logout

This commit is contained in:
Krille Fear 2021-10-14 17:05:59 +02:00
parent 4b3cd26f68
commit 4ba5e6270b

View file

@ -74,6 +74,9 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
widget.clients.indexWhere((client) => client.userID == matrixId);
int get _safeActiveClient {
if (widget.clients.isEmpty) {
widget.clients.add(getLoginClient());
}
if (activeClient < 0 || activeClient >= widget.clients.length) {
return 0;
}