mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
Fix missing module source panic (#1888)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
This commit is contained in:
parent
762eac259b
commit
6f01428333
@ -12,6 +12,7 @@ ENHANCEMENTS:
|
|||||||
|
|
||||||
BUG FIXES:
|
BUG FIXES:
|
||||||
* Ensure that using a sensitive path for templatefile that it doesn't panic([#1801](https://github.com/opentofu/opentofu/issues/1801))
|
* Ensure that using a sensitive path for templatefile that it doesn't panic([#1801](https://github.com/opentofu/opentofu/issues/1801))
|
||||||
|
* Fixed crash when module source is not present ([#1888](https://github.com/opentofu/opentofu/pull/1888))
|
||||||
|
|
||||||
## Previous Releases
|
## Previous Releases
|
||||||
|
|
||||||
|
@ -138,12 +138,15 @@ func buildChildModules(parent *Config, walker ModuleWalker) (map[string]*Config,
|
|||||||
Name: call.Name,
|
Name: call.Name,
|
||||||
Path: path,
|
Path: path,
|
||||||
SourceAddr: call.SourceAddr,
|
SourceAddr: call.SourceAddr,
|
||||||
SourceAddrRange: call.Source.Range(),
|
|
||||||
VersionConstraint: call.Version,
|
VersionConstraint: call.Version,
|
||||||
Parent: parent,
|
Parent: parent,
|
||||||
CallRange: call.DeclRange,
|
CallRange: call.DeclRange,
|
||||||
Call: NewStaticModuleCall(path, call.Variables, parent.Root.Module.SourceDir, call.Workspace),
|
Call: NewStaticModuleCall(path, call.Variables, parent.Root.Module.SourceDir, call.Workspace),
|
||||||
}
|
}
|
||||||
|
if call.Source != nil {
|
||||||
|
// Invalid modules sometimes have a nil source field which is handled through loadModule below
|
||||||
|
req.SourceAddrRange = call.Source.Range()
|
||||||
|
}
|
||||||
child, modDiags := loadModule(parent.Root, &req, walker)
|
child, modDiags := loadModule(parent.Root, &req, walker)
|
||||||
diags = append(diags, modDiags...)
|
diags = append(diags, modDiags...)
|
||||||
if child == nil {
|
if child == nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user