Settings: bluetooth: Fix generateSummary out-of-bounds

This commit is contained in:
flakeforever
2025-03-06 20:30:49 +09:00
committed by Joey
parent 96d8d44bcd
commit 3edcf6f6c6

View File

@@ -130,7 +130,7 @@ public abstract class BaseBluetoothDialogPreference extends CustomDialogPreferen
* Method to get summary strings by index.
*/
protected String generateSummary(int index) {
if (index > mSummaryStrings.size()) {
if (index >= mSummaryStrings.size()) {
Log.e(TAG, "Unable to get summary of " + index + ". Size is " + mSummaryStrings.size());
return null;
}