From 566a72744a0ac4fbd4fb0a297703979d06710e3d Mon Sep 17 00:00:00 2001 From: Guilherme Salgado Date: Fri, 10 Feb 2017 14:54:43 +0100 Subject: [PATCH] Check that msg.To() is not nil in GetVMEnv Otherwise it will panic when msg is creating a contract. Closes: #50 --- eth/api_backend.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eth/api_backend.go b/eth/api_backend.go index 2e82fc846fd8..e5bc291032d6 100644 --- a/eth/api_backend.go +++ b/eth/api_backend.go @@ -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 }