From 0343497521a716ae79841542a818d4a86bcdb5d9 Mon Sep 17 00:00:00 2001 From: Mikel Corcuera Date: Fri, 19 Sep 2025 12:07:55 +0200 Subject: [PATCH] Fix AVAudioSession() method handler throwing when arguments where null --- CHANGELOG.md | 4 ++++ lib/src/darwin.dart | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0d237e..9b02cb9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.2.3 + +* Fix AVAudioSession() method handler throwing when arguments where null (@snipd-mikel). + ## 0.2.2 * Run setCategory in a thread on iOS to avoid jank (@MinseokKang003). diff --git a/lib/src/darwin.dart b/lib/src/darwin.dart index 49c46ae..bb84907 100644 --- a/lib/src/darwin.dart +++ b/lib/src/darwin.dart @@ -30,7 +30,9 @@ class AVAudioSession { AVAudioSession._() { _channel.setMethodCallHandler((MethodCall call) async { - final args = call.arguments as List; + final args = call.arguments == null + ? [] + : call.arguments as List; switch (call.method) { case 'onInterruptionEvent': _interruptionNotificationSubject