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 org.nuclearfog.twidda.backend.api.ConnectionException;
|
||||||
|
|
||||||
|
import java.net.UnknownHostException;
|
||||||
|
|
||||||
import okhttp3.Response;
|
import okhttp3.Response;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -20,6 +22,9 @@ public class MastodonException extends ConnectionException {
|
||||||
*/
|
*/
|
||||||
public MastodonException(Exception e) {
|
public MastodonException(Exception e) {
|
||||||
super(e);
|
super(e);
|
||||||
|
if (e instanceof UnknownHostException) {
|
||||||
|
errorCode = NO_CONNECTION;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class MastodonPoll implements Poll {
|
||||||
options[i] = new MastodonOption(option);
|
options[i] = new MastodonOption(option);
|
||||||
}
|
}
|
||||||
if (votesJson != null) {
|
if (votesJson != null) {
|
||||||
for (int i = 0; i < optionsJson.length(); i++) {
|
for (int i = 0; i < votesJson.length(); i++) {
|
||||||
int index = votesJson.getInt(i);
|
int index = votesJson.getInt(i);
|
||||||
if (index >= 0 && index < options.length) {
|
if (index >= 0 && index < options.length) {
|
||||||
options[index].setSelected();
|
options[index].setSelected();
|
||||||
|
|
Loading…
Reference in New Issue