Skip to content

Commit 21f7020

Browse files
committed
channel [nfc]: Add assertions when handling SubscriptionRemoveEvent
1 parent 8e82e9e commit 21f7020

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/model/channel.dart

+5
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,11 @@ class ChannelStoreImpl with ChannelStore {
168168

169169
case SubscriptionRemoveEvent():
170170
for (final streamId in event.streamIds) {
171+
assert(streams.containsKey(streamId)
172+
&& streams[streamId] is Subscription);
173+
assert(streamsByName.containsKey(streams[streamId]!.name)
174+
&& streamsByName[streams[streamId]!.name] is Subscription);
175+
assert(subscriptions.containsKey(streamId));
171176
subscriptions.remove(streamId);
172177
}
173178

0 commit comments

Comments
 (0)