Skip to content

Commit 3da0876

Browse files
author
Android Code Review
committed
Merge change 10328
* changes: Prevent IndexOutOfBoundsException on toString() if vibrate array is empty (non null) example: notification.vibrate = new long[0];
2 parents 4ea496d + bdf7824 commit 3da0876

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

core/java/android/app/Notification.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,9 @@ public String toString() {
460460
sb.append(this.vibrate[i]);
461461
sb.append(',');
462462
}
463-
sb.append(this.vibrate[N]);
463+
if (N != -1) {
464+
sb.append(this.vibrate[N]);
465+
}
464466
sb.append("]");
465467
} else if ((this.defaults & DEFAULT_VIBRATE) != 0) {
466468
sb.append("default");

0 commit comments

Comments
 (0)