bug fix
This commit is contained in:
parent
e06aa84641
commit
193b9e0182
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue