diff --git a/Changelog.md b/Changelog.md
index dfb3c4d00..37fe0d2d4 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -1,5 +1,12 @@
# Most recent version
+## v3.1.2
+```
+- Fixed a crash some users experienced when trying to open a game
+```
+
+# Legacy versions
+
## v3.1.1
```
This version contains a bunch of bug fixes! Here's just a few:
@@ -8,8 +15,6 @@ This version contains a bunch of bug fixes! Here's just a few:
- Prevented scores from dropping below zero when there are too many fouls
```
-# Legacy versions
-
## v3.1.0
```
Thank you for using the app while some of the kinks in the new version are worked out!
diff --git a/app/build.gradle b/app/build.gradle
index 80568badd..e49e1c616 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -6,7 +6,7 @@ apply plugin: 'kotlin-android-extensions'
def versionMajor = 3
def versionMinor = 1
-def versionPatch = 1
+def versionPatch = 2
android {
compileSdkVersion 28
diff --git a/app/src/main/assets/changelog.txt b/app/src/main/assets/changelog.txt
index 9deb1efd0..51d897e05 100644
--- a/app/src/main/assets/changelog.txt
+++ b/app/src/main/assets/changelog.txt
@@ -1,3 +1,6 @@
+v3.1.2
+- Fixed a crash some users experienced when trying to open a game
+
v3.1.1
This version contains a bunch of bug fixes! Here's just a few:
- Creating or opening an event should no longer crash the app
diff --git a/app/src/main/java/ca/josephroque/bowlingcompanion/games/GameFragment.kt b/app/src/main/java/ca/josephroque/bowlingcompanion/games/GameFragment.kt
index 59ae39573..50ebc21f0 100644
--- a/app/src/main/java/ca/josephroque/bowlingcompanion/games/GameFragment.kt
+++ b/app/src/main/java/ca/josephroque/bowlingcompanion/games/GameFragment.kt
@@ -258,6 +258,10 @@ class GameFragment : BaseFragment(),
pinLayout.updatePinImage(index, pin.isDown)
}
+ // Update next/prev frame buttons
+ gameHeader.hasPreviousFrame = !gameState.isFirstBall && !gameState.currentGame.isManual
+ gameHeader.hasNextFrame = delegate?.isFabEnabled == true
+
// Set which pins are enabled/disabled
if (gameState.currentGame.isLocked) {
for (i in 0 until Game.NUMBER_OF_PINS) { pinLayout.setPinEnabled(i, false) }
@@ -466,8 +470,6 @@ class GameFragment : BaseFragment(),
render(ballChanged = true)
invalidateFab()
- gameHeader.hasPreviousFrame = !gameState.isFirstBall && !gameState.currentGame.isManual
- gameHeader.hasNextFrame = delegate?.isFabEnabled == true
if (gameState.isLastBall) {
autoEventController.delay(GameAutoEventController.AutoEvent.Lock)
} else {
diff --git a/app/src/main/java/ca/josephroque/bowlingcompanion/statistics/graph/StatisticGraphFragment.kt b/app/src/main/java/ca/josephroque/bowlingcompanion/statistics/graph/StatisticGraphFragment.kt
index 16f03dbca..d04884bf7 100644
--- a/app/src/main/java/ca/josephroque/bowlingcompanion/statistics/graph/StatisticGraphFragment.kt
+++ b/app/src/main/java/ca/josephroque/bowlingcompanion/statistics/graph/StatisticGraphFragment.kt
@@ -185,7 +185,7 @@ class StatisticGraphFragment : BaseFragment(),
val context = context ?: return
launch(Android) {
val (graphLines, graphLabels) = unit.getStatisticGraphData(context, statisticId, switchAccumulate.isChecked).await()
- if (graphLines[0].entries.size <= 1 || graphLabels.size <= 1) {
+ if (graphLines.isEmpty() || graphLines[0].entries.size <= 1 || graphLabels.size <= 1) {
return@launch
}