diff --git a/tests/state_test.go b/tests/state_test.go index 43009afdd..01ed1772e 100644 --- a/tests/state_test.go +++ b/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) })