From b07858a66d0332b63a711569ca134ae3df41c2a2 Mon Sep 17 00:00:00 2001 From: sk Date: Thu, 16 Feb 2023 17:04:56 +0100 Subject: [PATCH] don't crash when language array empty --- .../src/main/java/org/joinmastodon/android/model/Instance.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/model/Instance.java b/mastodon/src/main/java/org/joinmastodon/android/model/Instance.java index b1cc26252..09aae3adc 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/model/Instance.java +++ b/mastodon/src/main/java/org/joinmastodon/android/model/Instance.java @@ -121,7 +121,7 @@ public class Instance extends BaseModel{ ci.domain=uri; ci.normalizedDomain=IDN.toUnicode(uri); ci.description=Html.fromHtml(shortDescription).toString().trim(); - if(languages!=null){ + if(languages!=null && languages.size() > 0){ ci.language=languages.get(0); ci.languages=languages; }else{