mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-24 08:49:29 +00:00
tests: fix nil pointer panic on failure (#23053)
This commit is contained in:
parent
97ce6dfa6d
commit
58aeab77d2
1 changed files with 4 additions and 2 deletions
|
|
@ -74,8 +74,10 @@ func TestState(t *testing.T) {
|
||||||
t.Run(key+"/snap", func(t *testing.T) {
|
t.Run(key+"/snap", func(t *testing.T) {
|
||||||
withTrace(t, test.gasLimit(subtest), func(vmconfig vm.Config) error {
|
withTrace(t, test.gasLimit(subtest), func(vmconfig vm.Config) error {
|
||||||
snaps, statedb, err := test.Run(subtest, vmconfig, true)
|
snaps, statedb, err := test.Run(subtest, vmconfig, true)
|
||||||
if _, err := snaps.Journal(statedb.IntermediateRoot(false)); err != nil {
|
if snaps != nil && statedb != nil {
|
||||||
return err
|
if _, err := snaps.Journal(statedb.IntermediateRoot(false)); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return st.checkFailure(t, err)
|
return st.checkFailure(t, err)
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue