tests: fix nil pointer panic on failure (#23053)

pull/23068/head
Marius van der Wijden 3 years ago committed by GitHub
parent 97ce6dfa6d
commit 58aeab77d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      tests/state_test.go

@ -74,8 +74,10 @@ func TestState(t *testing.T) {
t.Run(key+"/snap", func(t *testing.T) {
withTrace(t, test.gasLimit(subtest), func(vmconfig vm.Config) error {
snaps, statedb, err := test.Run(subtest, vmconfig, true)
if _, err := snaps.Journal(statedb.IntermediateRoot(false)); err != nil {
return err
if snaps != nil && statedb != nil {
if _, err := snaps.Journal(statedb.IntermediateRoot(false)); err != nil {
return err
}
}
return st.checkFailure(t, err)
})

Loading…
Cancel
Save