mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
Prevent NPE
This commit is contained in:
@@ -66,6 +66,8 @@ public class ComputerUtilMana {
|
|||||||
|
|
||||||
// Does not check if mana sources can be used right now, just checks for potential chance.
|
// Does not check if mana sources can be used right now, just checks for potential chance.
|
||||||
public static boolean hasEnoughManaSourcesToCast(final SpellAbility sa, final Player ai) {
|
public static boolean hasEnoughManaSourcesToCast(final SpellAbility sa, final Player ai) {
|
||||||
|
if(ai == null || sa == null)
|
||||||
|
return false;
|
||||||
sa.setActivatingPlayer(ai);
|
sa.setActivatingPlayer(ai);
|
||||||
return payManaCost(sa, ai, true, 0, false);
|
return payManaCost(sa, ai, true, 0, false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -186,7 +186,9 @@ public class MatchController extends AbstractGuiGame {
|
|||||||
final PlayerView p = gameView.getPlayerTurn();
|
final PlayerView p = gameView.getPlayerTurn();
|
||||||
final PhaseType ph = gameView.getPhase();
|
final PhaseType ph = gameView.getPhase();
|
||||||
|
|
||||||
final PhaseLabel lbl = view.getPlayerPanel(p).getPhaseIndicator().getLabel(ph);
|
PhaseLabel lbl = null;
|
||||||
|
if(p != null && ph != null)
|
||||||
|
lbl = view.getPlayerPanel(p).getPhaseIndicator().getLabel(ph);
|
||||||
|
|
||||||
view.resetAllPhaseButtons();
|
view.resetAllPhaseButtons();
|
||||||
if (lbl != null) {
|
if (lbl != null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user