mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
update NPE prevention
This commit is contained in:
@@ -66,12 +66,11 @@ public class VZoneDisplay extends VCardDisplayArea {
|
||||
}
|
||||
|
||||
private void setRevealedPanel(int idx) {
|
||||
try {
|
||||
revealedPanel = cardPanels().get(idx); //on network match, when zoomed and cast a card would randomly trigger the bug
|
||||
} catch (Exception e) { //before it was arrayindexoutofbounds, then indexoutofbounds, so just use a general exception
|
||||
//e.printStackTrace();
|
||||
if (idx >= 0 && idx < cardPanels().size())
|
||||
revealedPanel = cardPanels().get(idx);
|
||||
else
|
||||
return;
|
||||
}
|
||||
|
||||
clearChildren();
|
||||
if (Forge.isLandscapeMode()) {
|
||||
//for landscape mode, just show revealed card on top
|
||||
|
||||
Reference in New Issue
Block a user