aboutsummaryrefslogtreecommitdiffstats
path: root/ethpub/pub.go
diff options
context:
space:
mode:
Diffstat (limited to 'ethpub/pub.go')
-rw-r--r--ethpub/pub.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/ethpub/pub.go b/ethpub/pub.go
index c6f177124..3c579001e 100644
--- a/ethpub/pub.go
+++ b/ethpub/pub.go
@@ -87,7 +87,7 @@ func (lib *PEthereum) createTx(key, recipient, valueStr, gasStr, gasPriceStr, in
tx = ethchain.NewContractCreationTx(value, gas, gasPrice, mainScript, initScript)
} else {
// Just in case it was submitted as a 0x prefixed string
- if initStr[0:2] == "0x" {
+ if len(initStr) > 0 && initStr[0:2] == "0x" {
initStr = initStr[2:len(initStr)]
}
tx = ethchain.NewTransactionMessage(hash, value, gas, gasPrice, ethutil.FromHex(initStr))