This commit is contained in:
nuclearfog 2022-12-25 13:10:21 +01:00
parent e06aa84641
commit 193b9e0182
No known key found for this signature in database
GPG Key ID: 03488A185C476379
2 changed files with 6 additions and 1 deletions

View File

@ -2,6 +2,8 @@ package org.nuclearfog.twidda.backend.api.mastodon;
import org.nuclearfog.twidda.backend.api.ConnectionException;
import java.net.UnknownHostException;
import okhttp3.Response;
/**
@ -20,6 +22,9 @@ public class MastodonException extends ConnectionException {
*/
public MastodonException(Exception e) {
super(e);
if (e instanceof UnknownHostException) {
errorCode = NO_CONNECTION;
}
}
/**

View File

@ -43,7 +43,7 @@ public class MastodonPoll implements Poll {
options[i] = new MastodonOption(option);
}
if (votesJson != null) {
for (int i = 0; i < optionsJson.length(); i++) {
for (int i = 0; i < votesJson.length(); i++) {
int index = votesJson.getInt(i);
if (index >= 0 && index < options.length) {
options[index].setSelected();