From b1ecbdc929fec22d89440c2d5e0a48b259cb5f14 Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Sun, 5 May 2019 10:58:36 +0530 Subject: [PATCH] Handle return_data=None case --- mythril/laser/ethereum/transaction/transaction_models.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mythril/laser/ethereum/transaction/transaction_models.py b/mythril/laser/ethereum/transaction/transaction_models.py index 9ad5b76e..3c5aabf4 100644 --- a/mythril/laser/ethereum/transaction/transaction_models.py +++ b/mythril/laser/ethereum/transaction/transaction_models.py @@ -180,11 +180,12 @@ class ContractCreationTransaction(BaseTransaction): :param revert: """ if ( - not all([isinstance(element, int) for element in return_data]) + return_data is None + or not all([isinstance(element, int) for element in return_data]) or len(return_data) == 0 ): self.return_data = None - raise TransactionEndSignal(global_state) + raise TransactionEndSignal(global_state, revert=revert) contract_code = bytes.hex(array.array("B", return_data).tostring())