Commit 8326be8
committed
resource(instance): fix provider crash when boot_disk_id is empty
Added a nil pointer check to prevent a nil pointer dereference
causing the provider to crash when `boot_disk_id` is empty and
`disk_attachments` is non-empty.
The following configuration now successfully applies.
```hcl
resource "oxide_instance" "example" {
project_id = data.oxide_project.example.id
description = "example"
name = "example"
host_name = "example"
memory = 1024 * 1024 * 1024
ncpus = 2
disk_attachments = [oxide_disk.example.id]
}
```
Fixes #466.1 parent 0bfc1e7 commit 8326be8
1 file changed
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1216 | 1216 | | |
1217 | 1217 | | |
1218 | 1218 | | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
1219 | 1223 | | |
1220 | 1224 | | |
1221 | 1225 | | |
| |||
0 commit comments