don't allow EvalWriteState without a provider
This commit is contained in:
parent
06a75b8038
commit
e73a8bb627
|
@ -212,6 +212,10 @@ func (n *EvalWriteState) Eval(ctx EvalContext) (interface{}, error) {
|
|||
absAddr := n.Addr.Absolute(ctx.Path())
|
||||
state := ctx.State()
|
||||
|
||||
if n.ProviderAddr.ProviderConfig.Type == "" {
|
||||
return nil, fmt.Errorf("failed to write state for %s, missing provider type", absAddr)
|
||||
}
|
||||
|
||||
obj := *n.State
|
||||
if obj == nil || obj.Value.IsNull() {
|
||||
// No need to encode anything: we'll just write it directly.
|
||||
|
|
Loading…
Reference in New Issue