fix: fix crashes when previewUrl is null on calckey

This commit is contained in:
LucasGGamerM 2023-05-13 21:18:00 -03:00
parent 3fda9e9eab
commit 0cd0b9d580
1 changed files with 2 additions and 2 deletions

View File

@ -55,8 +55,8 @@ public class MediaGridStatusDisplayItem extends StatusDisplayItem{
for(Attachment att:attachments){
requests.add(new UrlImageLoaderRequest(switch(att.type){
case IMAGE -> att.url;
case VIDEO, GIFV -> att.previewUrl;
default -> throw new IllegalStateException("Unexpected value: "+att.type);
case VIDEO, GIFV -> att.previewUrl == null ? att.url : att.previewUrl;
default -> throw new IllegalStateException("Unexpected value: "+att.url);
}, 1000, 1000));
}
}