From 5e20d16dd4060a785358fd0860cf5bffd5b23c09 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 10 Jul 2023 09:04:40 +1000 Subject: [PATCH] Don't try to enable a NULL device If there is no other libinput device in our list (and next is thus NULL), skip the xf86AddEnabledDevice() call. Fixes #60 --- src/xf86libinput.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/xf86libinput.c b/src/xf86libinput.c index f7a7553..934a312 100644 --- a/src/xf86libinput.c +++ b/src/xf86libinput.c @@ -1505,7 +1505,8 @@ swap_registered_device(InputInfoPtr pInfo) input_lock(); xf86RemoveEnabledDevice(pInfo); - xf86AddEnabledDevice(next); + if (next) + xf86AddEnabledDevice(next); driver_context.registered_InputInfoPtr = next; input_unlock(); }