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,9 +34,12 @@ func (s *State) RefreshState() error {
return err return err
} }
state, err := terraform.ReadState(bytes.NewReader(payload.Data)) var state *terraform.State
if err != nil { if payload != nil {
return err state, err = terraform.ReadState(bytes.NewReader(payload.Data))
if err != nil {
return err
}
} }
s.state = state s.state = state