zmk icon indicating copy to clipboard operation
zmk copied to clipboard

fix(events): Add NULL check for `as_##event_type`.

Open mlouielu opened this issue 1 year ago • 3 comments

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.

mlouielu avatar Jan 24 '25 16:01 mlouielu

I'd like to see a logging message added to this.

nmunnich avatar Mar 02 '25 09:03 nmunnich

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.

joelspadin avatar Mar 03 '25 17:03 joelspadin

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.

nmunnich avatar Mar 03 '25 17:03 nmunnich