From 04f3f15fbd89b1f653e9e7d3b52d8edef871baa5 Mon Sep 17 00:00:00 2001 From: Shawn <44221603+shaspitz@users.noreply.github.com> Date: Wed, 20 Dec 2023 02:52:21 -0800 Subject: [PATCH] check for empty response in deploy create2 script --- geth-poa/util/deploy_create2.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/geth-poa/util/deploy_create2.sh b/geth-poa/util/deploy_create2.sh index e4d3f94b58..ead6fbc9c9 100755 --- a/geth-poa/util/deploy_create2.sh +++ b/geth-poa/util/deploy_create2.sh @@ -19,6 +19,10 @@ fi DATA='{"jsonrpc":"2.0","method":"eth_getCode","params":["0x4e59b44847b379578588920ca78fbf26c0b4956c", "latest"],"id":1}' RESPONSE=$(curl -s -X POST --data "$DATA" -H "Content-Type: application/json" $JSON_RPC) CODE=$(echo $RESPONSE | jq -r '.result') +if [ -z "$RESPONSE" ] || [ "$RESPONSE" == "null" ]; then + echo "Error: No response from JSON RPC at $JSON_RPC" + exit 1 +fi if [ "$CODE" != "0x" ]; then echo "Contract already deployed at 0x4e59b44847b379578588920ca78fbf26c0b4956c" exit 0