From 4b9a2945f43997c8b14acb46475a41cfee4bc1dc Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Thu, 19 Aug 2021 10:18:42 +0200 Subject: [PATCH] refactor: Null safe multilock --- lib/src/utils/multilock.dart | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/src/utils/multilock.dart b/lib/src/utils/multilock.dart index cc2973b8..035232ef 100644 --- a/lib/src/utils/multilock.dart +++ b/lib/src/utils/multilock.dart @@ -1,4 +1,3 @@ -// @dart=2.9 /* * Famedly Matrix SDK * Copyright (C) 2019, 2020, 2021 Famedly GmbH @@ -40,7 +39,7 @@ class MultiLock { if (_completers[key] != null) { futures.add(() async { while (_completers[key] != null) { - await _completers[key].future; + await _completers[key]!.future; } }()); } @@ -60,7 +59,7 @@ class MultiLock { // we just have to simply unlock all the completers for (final key in uniqueKeys) { if (_completers[key] != null) { - final completer = _completers[key]; + final completer = _completers[key]!; _completers.remove(key); completer.complete(); }