diff --git a/interchain_builder.go b/interchain_builder.go index 6370f903b..63dd0142f 100644 --- a/interchain_builder.go +++ b/interchain_builder.go @@ -115,8 +115,10 @@ func BuildInitialChainWithRelayer( t.Cleanup(func() { _ = ic.Close() - if err := r.StopRelayer(ctx, eRep); err != nil { - t.Logf("an error occurred while stopping the relayer: %s", err) + if r != nil { + if err := r.StopRelayer(ctx, eRep); err != nil { + t.Logf("an error occurred while stopping the relayer: %s", err) + } } })