Skip to content

Commit

Permalink
Check that msg.To() is not nil in GetVMEnv
Browse files Browse the repository at this point in the history
Otherwise it will panic when msg is creating a contract.

Closes: ethereum#50
  • Loading branch information
gsalgado committed Feb 10, 2017
1 parent 2e5bfda commit 566a727
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion eth/api_backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func (b *EthApiBackend) GetVMEnv(ctx context.Context, msg core.Message, state et
privateState = statedb.privateState
)

if !privateState.Exist(*msg.To()) {
if msg.To() != nil && !privateState.Exist(*msg.To()) {
privateState = publicState
}

Expand Down

0 comments on commit 566a727

Please sign in to comment.