zmk
zmk copied to clipboard
fix(events): Add NULL check for `as_##event_type`.
Fix #2792 where this cause segfault.
PR check-list
- [x] Branch has a clean commit history
- [x] Additional tests are included, if changing behaviors/core code that is testable.
- [x] Proper Copyright + License headers added to applicable files (Generally, we stick to "The ZMK Contributors" for copyrights to help avoid churn when files get edited)
- [x] Pre-commit used to check formatting of files, commit messages, etc.
- [x] Includes any necessary documentation changes.
I'd like to see a logging message added to this.
See also my comments on #2792. This is being used as a workaround to what I consider to be a design flaw in the display code. I wouldn't be opposed to adding this with an error log message, but then we'd log a bunch of errors every time the firmware starts up when using a display.
This is being used as a workaround to what I consider to be a design flaw in the display code.
Agree with this point. I'd like to see both fixes made simultaneously.