Prevent IndexOutOfBoundsException on toString() if vibrate array is empty (non null)

example: notification.vibrate = new long[0];
This commit is contained in:
Simon Schoar
2009-06-10 21:53:53 +02:00
committed by Jean-Baptiste Queru
parent ceac091e9a
commit d45c9f4ceb

View File

@@ -458,7 +458,9 @@ public class Notification implements Parcelable
sb.append(this.vibrate[i]);
sb.append(',');
}
sb.append(this.vibrate[N]);
if (N != -1) {
sb.append(this.vibrate[N]);
}
sb.append("]");
} else if ((this.defaults & DEFAULT_VIBRATE) != 0) {
sb.append("default");