From 1f0b163c2a7c59127f1c58bc923c81015c735bd5 Mon Sep 17 00:00:00 2001 From: Hugo Delaunay Date: Mon, 15 Jul 2024 11:09:59 +0200 Subject: [PATCH] fix(android): Fixed a `ConcurrentModificationException`. Fixed #93. --- packages/bonsoir/example/android/app/build.gradle | 2 +- .../fr/skyost/bonsoir/discovery/BonsoirServiceDiscovery.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/bonsoir/example/android/app/build.gradle b/packages/bonsoir/example/android/app/build.gradle index 22f36974..faf5a7f5 100644 --- a/packages/bonsoir/example/android/app/build.gradle +++ b/packages/bonsoir/example/android/app/build.gradle @@ -48,7 +48,7 @@ android { applicationId "fr.skyost.bonsoir_example" // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. - minSdkVersion 19 + minSdkVersion flutter.minSdkVersion targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName diff --git a/packages/bonsoir_android/android/src/main/kotlin/fr/skyost/bonsoir/discovery/BonsoirServiceDiscovery.kt b/packages/bonsoir_android/android/src/main/kotlin/fr/skyost/bonsoir/discovery/BonsoirServiceDiscovery.kt index 9cc2f344..5c5510d9 100644 --- a/packages/bonsoir_android/android/src/main/kotlin/fr/skyost/bonsoir/discovery/BonsoirServiceDiscovery.kt +++ b/packages/bonsoir_android/android/src/main/kotlin/fr/skyost/bonsoir/discovery/BonsoirServiceDiscovery.kt @@ -87,7 +87,7 @@ class BonsoirServiceDiscovery( * @param type The service type. */ private fun findService(name: String, type: String? = null): BonsoirService? { - for (service in services) { + for (service in ArrayList(services)) { if (name == service.name && (type == null || type == service.type)) { return service }