Skip to content

Commit

Permalink
Do not assume every client module has clientSpec
Browse files Browse the repository at this point in the history
  • Loading branch information
Chuntao Lu committed Mar 8, 2018
1 parent ad7c719 commit 30969a3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions codegen/module_system.go
Original file line number Diff line number Diff line change
Expand Up @@ -1276,9 +1276,8 @@ func GenerateMockInitializer(
) ([]byte, error) {
leafWithFixture := map[string]string{}
for _, leaf := range instance.RecursiveDependencies["client"] {
// cast is guaranteed to succeed at this point
spec := leaf.genSpec.(*ClientSpec)
if spec.Fixture != nil {
spec, ok := leaf.genSpec.(*ClientSpec)
if ok && spec.Fixture != nil {
leafWithFixture[leaf.InstanceName] = spec.Fixture.ImportPath
}
}
Expand Down

0 comments on commit 30969a3

Please sign in to comment.