From 7f6608d29d8fa75f7dc3d1af799f30f58087cc6f Mon Sep 17 00:00:00 2001 From: Brian Quinlan Date: Tue, 1 Oct 2024 18:25:23 -0700 Subject: [PATCH] Fix --- pkgs/cupertino_http/lib/src/cupertino_api.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/cupertino_http/lib/src/cupertino_api.dart b/pkgs/cupertino_http/lib/src/cupertino_api.dart index 8e870fa6e5..f072ce0d04 100644 --- a/pkgs/cupertino_http/lib/src/cupertino_api.dart +++ b/pkgs/cupertino_http/lib/src/cupertino_api.dart @@ -842,11 +842,11 @@ class URLSession extends _ObjectHolder { static void _decrementTaskCount() { assert(_taskCount > 0); + assert(_port != null); --_taskCount; - if (_taskCount == 0 && _port != null) { + if (_taskCount == 0) { _port?.close(); _port = null; - _taskCount = 0; } }