Skip to content
This repository was archived by the owner on Jun 25, 2024. It is now read-only.

Commit 85dc941

Browse files
authored
Merge pull request #17 from Orange-OpenSource/16-fix-bluetoothgatt
Fix #16
2 parents 5b2505a + ed672bd commit 85dc941

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

project/app/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ android {
3939
minSdkVersion rootProject.minSdkVersion
4040
targetSdkVersion rootProject.targetSdkVersion
4141
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
42-
versionCode 22
43-
versionName "0.6.0"
42+
versionCode 23
43+
versionName "0.7.0"
4444
vectorDrawables.useSupportLibrary true
4545
}
4646
buildTypes {

project/app/src/main/java/com/orange/labs/orangetrainingbox/ui/MainActivity.kt

+4-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ private val BluetoothAdapter.isDisabled: Boolean
7373
* @author Marc Poppleton
7474
* @author Pierre-Yves Lapersonne
7575
* @since 23/10/2018
76-
* @version 2.1.0
76+
* @version 2.1.1
7777
*/
7878
class MainActivity : AppCompatActivity() {
7979

@@ -247,7 +247,9 @@ class MainActivity : AppCompatActivity() {
247247
*/
248248
override fun onDestroy() {
249249
super.onDestroy()
250-
bluetoothGatt.close()
250+
if (::bluetoothGatt.isInitialized) {
251+
bluetoothGatt.close()
252+
}
251253
}
252254

253255
/**

project/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ buildscript {
2727
targetSdkVersion = 28
2828

2929
// App dependencies
30-
gradleVersion = '3.4.1'
30+
gradleVersion = '3.4.2'
3131
supportLibraryVersion = '1.0.2'
3232
kotlinVersion = '1.3.11'
3333
kotlinCoroutinesVersion = '1.0.1'

0 commit comments

Comments
 (0)