Merge branch 'master' into 'master'

prevent NPE

See merge request core-developers/forge!3668
This commit is contained in:
Anthony Calosa
2021-01-29 02:31:56 +00:00

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
try {
qty = parentScreen.getCatalogPage().cardManager.getItemCount(card); 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