1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-23 18:02:15 -05:00

Bugfix for negative modulo result indexing the palette array

This commit is contained in:
Stephan Fuhrmann 2013-07-23 23:27:44 +02:00
parent 64212072c0
commit d45c8b053b

View File

@ -163,7 +163,7 @@ public class ContactPictureLoader {
private int calcUnknownContactColor(Address address) {
int val = address.getAddress().toLowerCase().hashCode();
int rgb = CONTACT_DUMMY_COLORS_ARGB[val % CONTACT_DUMMY_COLORS_ARGB.length];
int rgb = CONTACT_DUMMY_COLORS_ARGB[Math.abs(val) % CONTACT_DUMMY_COLORS_ARGB.length];
return rgb;
}