# Fix edge case in switch with single else · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/59bc1d272120bd860cc3cd1f894a2a4e08fc1f3f)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 59bc1d272120bd860cc3cd1f894a2a4e08fc1f3f

Requested commit: 59bc1d272120bd860cc3cd1f894a2a4e08fc1f3f

Commit: 59bc1d272120bd860cc3cd1f894a2a4e08fc1f3f

Tree: 0b7eb6fd36762579a141d152b10e0d60b540b217

Author: LemonBoy

Committer: Andrew Kelley

## Message

```
Fix edge case in switch with single else

ir_gen_switch_expr doesn't set the switch_br field at all if there are
zero cases, detect this situation and handle it gracefully.

Closes #4322

```

## Parents

- [4fad16284ec30962689723c7eaca05a77df14673](https://git.cafe/gitcafe/zig/commit/4fad16284ec30962689723c7eaca05a77df14673?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/59bc1d272120bd860cc3cd1f894a2a4e08fc1f3f?format=markdown)
