Fix nil dereference.
This commit is contained in:
parent
47fa7c3d6b
commit
c798ba31e1
@ -83,7 +83,7 @@ func (s *SwitchingCard) Options(*Player) ([]CardOption, error) {
|
||||
func (s *SwitchingCard) Then(p *Player, o CardOption) error {
|
||||
newPolicy := o.(Policy)
|
||||
var errs cardsim.ErrorCollector
|
||||
if !newPolicy.Is(s.lastPolicy) {
|
||||
if s.lastPolicy != nil && !newPolicy.Is(s.lastPolicy) {
|
||||
err := s.lastPolicy.Unenact(p)
|
||||
if cardsim.IsSeriousError(err) {
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user