state/remote: can handle nil payloads
This commit is contained in:
parent
399319d31f
commit
1eec77378b
|
@ -34,10 +34,13 @@ func (s *State) RefreshState() error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
state, err := terraform.ReadState(bytes.NewReader(payload.Data))
|
var state *terraform.State
|
||||||
|
if payload != nil {
|
||||||
|
state, err = terraform.ReadState(bytes.NewReader(payload.Data))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
s.state = state
|
s.state = state
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in New Issue