Skip to content

Commit e4f9d1c

Browse files
committed
[Blockfrost] Check if inline datum and reference script exist before accessing them
1 parent 67c2c36 commit e4f9d1c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pycardano/backend/blockfrost.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,12 @@ def utxos(self, address: str) -> List[UTxO]:
171171

172172
datum = None
173173

174-
if result.inline_datum is not None:
174+
if hasattr(result, "inline_datum") and result.inline_datum is not None:
175175
datum = RawCBOR(bytes.fromhex(result.inline_datum))
176176

177177
script = None
178178

179-
if result.reference_script_hash:
179+
if hasattr(result, "reference_script_hash") and result.reference_script_hash:
180180
script = self._get_script(result.reference_script_hash)
181181

182182
tx_out = TransactionOutput(

0 commit comments

Comments
 (0)