Fix crashes on Calckey and GoToSocial (#515)

* Fix crashes on calckey and gts

* Use url if previewUrl is null
This commit is contained in:
Jacoco
2023-05-14 23:26:03 +02:00
committed by GitHub
parent 961c69b525
commit a9ab9cb249
3 changed files with 5 additions and 4 deletions

View File

@@ -55,7 +55,7 @@ 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;
case VIDEO, GIFV -> att.previewUrl != null ? att.previewUrl : att.url;
default -> throw new IllegalStateException("Unexpected value: "+att.type);
}, 1000, 1000));
}