Skip to content

Commit

Permalink
Problem: When a user send an instance message with the field `require…
Browse files Browse the repository at this point in the history
…ments` to null, the message is rejected.

Solution: Check if the `requirements` field have something relevant inside.
  • Loading branch information
nesitor committed Aug 27, 2024
1 parent 38f8fa7 commit 8133e0c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/aleph/handlers/content/vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,11 @@ def _map_content_to_db_model(item_hash, content):
if content.environment.trusted_execution is not None:
trusted_execution_policy = content.environment.trusted_execution.policy
trusted_execution_firmware = content.environment.trusted_execution.firmware
if hasattr(content, "requirements") and hasattr(content.requirements.node, 'node_hash'):
if (
hasattr(content, "requirements")
and hasattr(content.requirements, "node")
and hasattr(content.requirements.node, "node_hash")
):
node_hash = content.requirements.node.node_hash

return db_cls(
Expand Down

0 comments on commit 8133e0c

Please sign in to comment.