Skip to content

Commit

Permalink
Guard against preparing action mode with no checked verses
Browse files Browse the repository at this point in the history
  • Loading branch information
yukuku committed Jan 23, 2020
1 parent 7f352cc commit c8404c0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Alkitab/src/main/java/yuku/alkitab/base/IsiActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ import yuku.alkitab.base.util.History
import yuku.alkitab.base.util.InstallationUtil
import yuku.alkitab.base.util.Jumper
import yuku.alkitab.base.util.LidToAri
import yuku.alkitab.base.util.Literals.Array
import yuku.alkitab.base.util.OtherAppIntegration
import yuku.alkitab.base.util.RequestCodes
import yuku.alkitab.base.util.ShareUrl
Expand Down Expand Up @@ -524,6 +523,14 @@ class IsiActivity : BaseLeftDrawerActivity(), LeftDrawer.Text.Listener {
val selected = lsSplit0.getCheckedVerses_1()
val single = selected.size() == 1

// For unknown reasons the size of selected can be zero and get(0) causes crash.
// https://console.firebase.google.com/u/0/project/alkitab-host-hrd/crashlytics/app/android:yuku.alkitab/issues/cc11d3466c89303f88b9e27ab3fdd534
if (selected.size() == 0) {
AppLog.e(TAG, "@@onPrepareActionMode checked verses is empty.")
mode.finish()
return true
}

var contiguous = true
if (!single) {
var next = selected.get(0) + 1
Expand Down

0 comments on commit c8404c0

Please sign in to comment.