fix: NPE in PhotoViewer show avatar dc

This commit is contained in:
xtaodada 2024-06-08 10:04:49 +08:00
parent ba09fabdb1
commit 41dcf3edf0
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659

View File

@ -13622,7 +13622,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
}
CharSequence subtitle = null;
TLRPC.Photo avatar = avatarsArr.get(switchingToIndex);
if (avatar.date != 0) {
if (avatar != null && avatar.date != 0) {
subtitle = LocaleController.formatDateAudio(avatar.date, false);
subtitle = String.format(Locale.US, "%s, DC%d", subtitle, avatar.dc_id);
}