Skip to content

Commit ea87f29

Browse files
authored
Merge pull request #174 from nix-community/fix/touchpad-segault
fix: handle when udev data does not have an input entry
2 parents ca484aa + 52d21e2 commit ea87f29

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/hwinfo/input.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ func captureTouchpads(deviceIdx uint) ([]HardwareDevice, error) {
3131
return nil, fmt.Errorf("failed to fetch udev data for device %q with udev data: %w", path, err)
3232
}
3333

34+
if udevData.Input == nil {
35+
slog.Debug("udev data missing input", "name", inputDevice.Name, "sysfs", inputDevice.Sysfs)
36+
continue
37+
}
38+
3439
if !udevData.Input.IsTouchpad {
3540
// currently, we are only interested in touchpads, as hwinfo does not capture them
3641
// eventually, we may take over more of the input processing that hwinfo performs

0 commit comments

Comments
 (0)