Skip to content

Commit 566a727

Browse files
committed
Check that msg.To() is not nil in GetVMEnv
Otherwise it will panic when msg is creating a contract. Closes: #50
1 parent 2e5bfda commit 566a727

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

eth/api_backend.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func (b *EthApiBackend) GetVMEnv(ctx context.Context, msg core.Message, state et
102102
privateState = statedb.privateState
103103
)
104104

105-
if !privateState.Exist(*msg.To()) {
105+
if msg.To() != nil && !privateState.Exist(*msg.To()) {
106106
privateState = publicState
107107
}
108108

0 commit comments

Comments
 (0)