From 95872a241f5edd89f630e816cc539b49344cbb34 Mon Sep 17 00:00:00 2001 From: shubhral Date: Thu, 4 Feb 2021 14:24:50 +0530 Subject: [PATCH] fix timer issue --- example/lib/non_tc_screen.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/example/lib/non_tc_screen.dart b/example/lib/non_tc_screen.dart index 93237c3..9a2fb00 100644 --- a/example/lib/non_tc_screen.dart +++ b/example/lib/non_tc_screen.dart @@ -380,7 +380,9 @@ class _HomePageState extends State { if (streamSubscription != null) { streamSubscription.cancel(); } - _timer.cancel(); + if (_timer != null) { + _timer.cancel(); + } super.dispose(); } }