diff --git a/tests/state_test_util.go b/tests/state_test_util.go
index 227ef77cc4ed24b82a794c5558107de59c1fe789..97fd3fb6a89e7264bca14f25713e3c96566d0be0 100644
--- a/tests/state_test_util.go
+++ b/tests/state_test_util.go
@@ -328,6 +328,9 @@ func (tx *stTransaction) toMessage(ps stPostState, baseFee *big.Int) (core.Messa
 		gasPrice = math.BigMin(new(big.Int).Add(tx.MaxPriorityFeePerGas, baseFee),
 			tx.MaxFeePerGas)
 	}
+	if gasPrice == nil {
+		return nil, fmt.Errorf("no gas price provided")
+	}
 
 	msg := types.NewMessage(from, to, tx.Nonce, value, gasLimit, gasPrice,
 		tx.MaxFeePerGas, tx.MaxPriorityFeePerGas, data, accessList, true)