mirror of
https://github.com/opentffoundation/opentf.git
synced 2025-12-19 17:59:05 -05:00
states: SyncState.ResourceInstanceObjectFull tolerate missing resource
This was previously dealing okay with the case where a resource doesn't have the requested instance, but was not handling the situation where the resource doesn't exist at all yet. Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
This commit is contained in:
@@ -84,6 +84,9 @@ func (s *SyncState) ResourceInstanceObjectFull(addr addrs.AbsResourceInstance, d
|
||||
defer s.lock.RUnlock()
|
||||
|
||||
rsrc := s.state.Resource(addr.ContainingResource())
|
||||
if rsrc == nil {
|
||||
return nil
|
||||
}
|
||||
inst := rsrc.Instances[addr.Resource.Key]
|
||||
if inst == nil {
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user