Skip to content

Commit

Permalink
Fix possible crash
Browse files Browse the repository at this point in the history
  • Loading branch information
MatteCarra committed May 18, 2019
1 parent 1c9334c commit e7c485a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ android {
applicationId "mattecarra.accapp"
minSdkVersion 16
targetSdkVersion 28
versionCode 10
versionName "1.0.6"
versionCode 11
versionName "1.0.7"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/java/mattecarra/accapp/acc/Acc.kt
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ object Acc {
private const val latestVersion = 201905111

val instance: AccInterface by lazy {
val config = File(Environment.getExternalStorageDirectory(), "acc/config.txt").readText()
val constructor = try {
val config = File(Environment.getExternalStorageDirectory(), "acc/config.txt").readText()

val version = VERSION_REGEXP.find(config)?.destructured?.component1()?.toIntOrNull() ?: latestVersion
val version = VERSION_REGEXP.find(config)?.destructured?.component1()?.toIntOrNull() ?: latestVersion

val constructor = try {
val aClass = Class.forName("mattecarra.accapp.acc.v$version.AccHandler")
aClass.getDeclaredConstructor()
} catch (ex: Exception) {
Expand Down

0 comments on commit e7c485a

Please sign in to comment.