Skip to content

Commit de23f37

Browse files
committed
fix: mypy issue
1 parent 1835bc1 commit de23f37

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/aleph_client/commands/instance/display.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,10 +344,15 @@ def _prepare_allocation_column(self):
344344
color_allocation = "magenta3"
345345
crn_hash = safe_getattr(self.message.content.requirements, "node.node_hash") or ""
346346
else:
347-
crn_url = self.allocation.allocations.node.url
347+
allocation_node = (
348+
self.allocation.allocations.node
349+
if self.allocation.allocations and self.allocation.allocations.node
350+
else None
351+
)
352+
crn_url = allocation_node.url if allocation_node else ""
348353
allocation_str = ALLOCATION_AUTO
349354
color_allocation = "deep_sky_blue1"
350-
crn_hash = self.allocation.allocations.node.node_id
355+
crn_hash = allocation_node.node_id if allocation_node else ""
351356

352357
# Assemble the complete allocation column
353358
self.allocation_column = cast(

0 commit comments

Comments
 (0)