Fix Exception on Android downloader.

This commit is contained in:
valfieri
2019-08-23 12:45:17 +02:00
parent f4d9de9490
commit 30622010df
@@ -497,9 +497,12 @@ public class ImgDownloader {
for (int l = 1; l < arrays.length - 1; l++) { for (int l = 1; l < arrays.length - 1; l++) {
if (arrays[l].equalsIgnoreCase("creature") && arrays[l + 1].toLowerCase().contains("token")) { if (arrays[l].equalsIgnoreCase("creature") && arrays[l + 1].toLowerCase().contains("token")) {
nametoken = arrays[l - 1]; nametoken = arrays[l - 1];
if(l - 3 > 0)
tokenstats = arrays[l - 3]; tokenstats = arrays[l - 3];
if(nametoken.equalsIgnoreCase("artifact")){ if(nametoken.equalsIgnoreCase("artifact")){
if(l - 2 > 0)
nametoken = arrays[l - 2]; nametoken = arrays[l - 2];
if(l - 4 > 0)
tokenstats = arrays[l - 4]; tokenstats = arrays[l - 4];
} }
break; break;
@@ -512,7 +515,7 @@ public class ImgDownloader {
break; break;
} }
} }
if (nametoken.isEmpty()) { if (nametoken.isEmpty() || tokenstats.isEmpty()) {
tokenfound = false; tokenfound = false;
nametoken = "Unknown"; nametoken = "Unknown";
nametocheck = mappa.get(id); nametocheck = mappa.get(id);