Check that msg.To() is not nil in GetVMEnv

Otherwise it will panic when msg is creating a contract.

Closes: #50
This commit is contained in:
Guilherme Salgado 2017-02-10 14:54:43 +01:00
parent 2e5bfda900
commit 566a72744a
1 changed files with 1 additions and 1 deletions

View File

@ -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
}