prevent NPE

This commit is contained in:
Anthony Calosa
2021-01-29 10:30:01 +08:00
parent c6693afa29
commit 25c3f3601a

View File

@@ -806,7 +806,12 @@ public class FDeckEditor extends TabPageScreen<FDeckEditor> {
} }
else if (parentScreen.getEditorType() == EditorType.Quest||parentScreen.getEditorType() == EditorType.QuestCommander) { else if (parentScreen.getEditorType() == EditorType.Quest||parentScreen.getEditorType() == EditorType.QuestCommander) {
//prevent adding more than is in quest inventory //prevent adding more than is in quest inventory
qty = parentScreen.getCatalogPage().cardManager.getItemCount(card); try {
qty = parentScreen.getCatalogPage().cardManager.getItemCount(card);
} catch (Exception e) {
//prevent NPE
qty = 0;
}
} }
else { else {
//if not source of items being added, use max directly if unlimited pool //if not source of items being added, use max directly if unlimited pool