diff --git a/src/native/pixbufmanipulator.cpp b/src/native/pixbufmanipulator.cpp index 1d9553b0487af48d30fa6fcc079ee96a0edcbcc4..8559ce2de6dd99b9808cdfaee4f9cc8855fe9530 100644 --- a/src/native/pixbufmanipulator.cpp +++ b/src/native/pixbufmanipulator.cpp @@ -44,7 +44,16 @@ PixbufManipulator::generateAvatar(const ContactMethod* cm) const if (hashName.size() > 0) { cm_number = hashName.at(0); } - letter = cm->bestName().toUpper().at(0); + // Get the letter to draw + if (!cm->bestName().isEmpty()) { + // Prioritize the name + letter = cm->bestName().toUpper().at(0); + } else if (!cm->bestId().isEmpty()) { + // If the contact has no name, use the id + letter = cm->bestId().toUpper().at(0); + } else { + // R for ring is used + } } bool ok;