unchecked error

We don't need the nil checks if we check the error
This commit is contained in:
James Bardin 2020-11-30 17:34:58 -05:00
parent 810ab0386f
commit 11e5ab0376
1 changed files with 2 additions and 6 deletions

View File

@ -349,12 +349,8 @@ func (n *NodeAbstractResource) writeResourceState(ctx EvalContext, addr addrs.Ab
// the state.
func (n *NodeAbstractResource) ReadResourceInstanceState(ctx EvalContext, addr addrs.AbsResourceInstance) (*states.ResourceInstanceObject, error) {
provider, providerSchema, err := GetProvider(ctx, n.ResolvedProvider)
if provider == nil {
panic("ReadResourceInstanceState used with no Provider object")
}
if providerSchema == nil {
panic("ReadResourceInstanceState used with no ProviderSchema object")
if err != nil {
return nil, err
}
log.Printf("[TRACE] ReadResourceInstanceState: reading state for %s", addr)