Skip to content

Commit 82f4541

Browse files
committed
safely check if realtime.conn is not null to avoid null check operator used on null value
1 parent 369dcc2 commit 82f4541

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/supabase_flutter/lib/src/supabase.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,8 @@ class Supabase with WidgetsBindingObserver {
233233
Future<void> onResumed() async {
234234
final realtime = Supabase.instance.client.realtime;
235235
if (realtime.channels.isNotEmpty) {
236-
if (realtime.connState == SocketStates.disconnecting) {
236+
if (realtime.connState == SocketStates.disconnecting &&
237+
realtime.conn != null) {
237238
// If the socket is still disconnecting from e.g.
238239
// [AppLifecycleState.paused] we should wait for it to finish before
239240
// reconnecting.

0 commit comments

Comments
 (0)