state/remote: can handle nil payloads

This commit is contained in:
Mitchell Hashimoto 2015-02-21 15:15:39 -08:00
parent 399319d31f
commit 1eec77378b
1 changed files with 6 additions and 3 deletions

View File

@ -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