Skip to content

Commit bdf7824

Browse files
author
Simon Schoar
committed
Prevent IndexOutOfBoundsException on toString() if vibrate array is empty (non null)
example: notification.vibrate = new long[0];
1 parent 734bc9b commit bdf7824

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)