Skip to content

Commit

Permalink
Fix Exception on Android downloader.
Browse files Browse the repository at this point in the history
  • Loading branch information
valfieri committed Aug 23, 2019
1 parent f4d9de9 commit 3062201
Showing 1 changed file with 22 additions and 19 deletions.
41 changes: 22 additions & 19 deletions projects/mtg/Android/src/net/wagic/utils/ImgDownloader.java
Original file line number Diff line number Diff line change
Expand Up @@ -494,25 +494,28 @@ else if(scryset.equalsIgnoreCase("ZVE"))
String nametoken = "";
String nametocheck = "";
String tokenstats = "";
for (int l = 1; l < arrays.length - 1; l++) {
if (arrays[l].equalsIgnoreCase("creature") && arrays[l + 1].toLowerCase().contains("token")) {
nametoken = arrays[l - 1];
tokenstats = arrays[l - 3];
if(nametoken.equalsIgnoreCase("artifact")){
nametoken = arrays[l - 2];
tokenstats = arrays[l - 4];
}
break;
} else if (arrays[l].equalsIgnoreCase("put") && arrays[l + 3].toLowerCase().contains("token")) {
nametoken = arrays[l + 2];
for (int j = 1; j < arrays.length - 1; j++) {
if (arrays[j].contains("/"))
tokenstats = arrays[j];
}
break;
}
}
if (nametoken.isEmpty()) {
for (int l = 1; l < arrays.length - 1; l++) {
if (arrays[l].equalsIgnoreCase("creature") && arrays[l + 1].toLowerCase().contains("token")) {
nametoken = arrays[l - 1];
if(l - 3 > 0)
tokenstats = arrays[l - 3];
if(nametoken.equalsIgnoreCase("artifact")){
if(l - 2 > 0)
nametoken = arrays[l - 2];
if(l - 4 > 0)
tokenstats = arrays[l - 4];
}
break;
} else if (arrays[l].equalsIgnoreCase("put") && arrays[l + 3].toLowerCase().contains("token")) {
nametoken = arrays[l + 2];
for (int j = 1; j < arrays.length - 1; j++) {
if (arrays[j].contains("/"))
tokenstats = arrays[j];
}
break;
}
}
if (nametoken.isEmpty() || tokenstats.isEmpty()) {
tokenfound = false;
nametoken = "Unknown";
nametocheck = mappa.get(id);
Expand Down

0 comments on commit 3062201

Please sign in to comment.