Skip to content

Commit a4d8431

Browse files
committed
Minor changes
1 parent e594215 commit a4d8431

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

app/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
def final VERSION_CODE = 26
2-
def final VERSION_NAME = '1.2.4'
1+
def final VERSION_CODE = 27
2+
def final VERSION_NAME = '1.2.5'
33

44
apply plugin: 'com.android.application'
55
apply plugin: 'kotlin-android'
@@ -125,7 +125,7 @@ dependencies {
125125
implementation 'com.github.chrisbanes:PhotoView:2.1.3'
126126
implementation 'io.github.kobakei:ratethisapp:1.2.0'
127127

128-
implementation('com.crashlytics.sdk.android:crashlytics:2.9.2@aar') {
128+
implementation('com.crashlytics.sdk.android:crashlytics:2.9.3@aar') {
129129
transitive = true
130130
}
131131

app/src/main/kotlin/com/glodanif/bluetoothchat/data/model/BluetoothConnectorImpl.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,25 +312,25 @@ class BluetoothConnectorImpl(private val context: Context) : BluetoothConnector
312312

313313
override fun removeOnPrepareListener(listener: OnPrepareListener) {
314314
synchronized(monitor) {
315-
prepareListeners safeRemove listener
315+
prepareListeners.safeRemove(listener)
316316
}
317317
}
318318

319319
override fun removeOnConnectListener(listener: OnConnectionListener) {
320320
synchronized(monitor) {
321-
connectListeners safeRemove listener
321+
connectListeners.safeRemove(listener)
322322
}
323323
}
324324

325325
override fun removeOnMessageListener(listener: OnMessageListener) {
326326
synchronized(monitor) {
327-
messageListeners safeRemove listener
327+
messageListeners.safeRemove(listener)
328328
}
329329
}
330330

331331
override fun removeOnFileListener(listener: OnFileListener) {
332332
synchronized(monitor) {
333-
fileListeners safeRemove listener
333+
fileListeners.safeRemove(listener)
334334
}
335335
}
336336

app/src/main/kotlin/com/glodanif/bluetoothchat/data/service/TransferEventStrategy.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class TransferEventStrategy : DataTransferThread.EventsStrategy {
2020
message.substring(2).substringBefore("#").toLong()
2121
} catch (e: NumberFormatException) {
2222

23-
val exception = NumberFormatException(e.message + " | " + message)
23+
val exception = NumberFormatException(e.message + " | " + fileStartRegex.find(message)?.value)
2424

2525
if (Fabric.isInitialized()) {
2626
Crashlytics.getInstance().core.logException(exception)

app/src/main/kotlin/com/glodanif/bluetoothchat/utils/Extensions.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,14 @@ fun Animation.onEnd(action: () -> Unit) {
5757
})
5858
}
5959

60-
infix fun <T> MutableSet<T>.safeRemove(item: T) = this.iterator().let {
60+
inline fun <T> MutableSet<T>.safeForEach(action: (T) -> Unit) = this.iterator().let {
61+
62+
while (it.hasNext()) {
63+
action.invoke(it.next())
64+
}
65+
}
66+
67+
fun <T> MutableSet<T>.safeRemove(item: T) = this.iterator().let {
6168

6269
while (it.hasNext()) {
6370
if (it.next() == item) {

0 commit comments

Comments
 (0)