Commit 28a2efd
committed
Fixed the crash when clicking/selecting a dataset
Prompt:
When clicking on a dataset I am receiving this error
```
╭────────────────────────────────────────────────────────────────────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────────────────────────────────────────────────────────────────╮
│ /home/sergio/Projects/sergiovibes/zfs-dashboard-python/src/zfs_dashboard/ui/screens.py:141 in on_dataset_tree_widget_selected │
│ │
│ 138 │ │ ╭────────── locals ───────────╮ │
│ 139 │ │ # The message bubbles up from the tree. │ message = Selected() │ │
│ 140 │ │ # We can look at message.control.id to find the pool name │ self = DashboardScreen() │ │
│ ❱ 141 │ │ tree_id = message.control.id # e.g. tree-tank ╰─────────────────────────────╯ │
│ 142 │ │ if tree_id and tree_id.startswith("tree-"): │
│ 143 │ │ │ pool_name = tree_id.split("-", 1)[1] │
│ 144 │ │ │ details = self.query_one(f"#details-{pool_name}", DatasetDetails) │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: 'NoneType' object has no attribute 'id'
```1 parent 42e19c9 commit 28a2efd
2 files changed
+4
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
| 141 | + | |
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
| 97 | + | |
98 | 98 | | |
| 99 | + | |
99 | 100 | | |
100 | 101 | | |
101 | 102 | | |
| |||
170 | 171 | | |
171 | 172 | | |
172 | 173 | | |
173 | | - | |
| 174 | + | |
174 | 175 | | |
175 | 176 | | |
176 | 177 | | |
| |||
0 commit comments