mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-25 20:25:45 +01:00
Avoid exception from misconfigured SQL table
This commit is contained in:
parent
ba1aa443e3
commit
613ba96e34
@ -629,6 +629,7 @@ public class SqlStorage implements StorageImplementation {
|
|||||||
string = string.replace("{", "").replace("}", "");
|
string = string.replace("{", "").replace("}", "");
|
||||||
int index = 0;
|
int index = 0;
|
||||||
for (final String section : string.split(",")) {
|
for (final String section : string.split(",")) {
|
||||||
|
if (index < objective.size()) {
|
||||||
final int amt = Integer.parseInt(section);
|
final int amt = Integer.parseInt(section);
|
||||||
final ItemStack is = objective.get(index);
|
final ItemStack is = objective.get(index);
|
||||||
final ItemStack temp = new ItemStack(is.getType(), amt, is.getDurability());
|
final ItemStack temp = new ItemStack(is.getType(), amt, is.getDurability());
|
||||||
@ -636,6 +637,9 @@ public class SqlStorage implements StorageImplementation {
|
|||||||
temp.setItemMeta(is.getItemMeta());
|
temp.setItemMeta(is.getItemMeta());
|
||||||
list.add(temp);
|
list.add(temp);
|
||||||
index++;
|
index++;
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
|
Loading…
Reference in New Issue
Block a user