diff --git a/Userland/Services/WindowServer/EventLoop.cpp b/Userland/Services/WindowServer/EventLoop.cpp index 21dae58823..b8fdfcc3be 100644 --- a/Userland/Services/WindowServer/EventLoop.cpp +++ b/Userland/Services/WindowServer/EventLoop.cpp @@ -66,14 +66,19 @@ EventLoop::EventLoop() IPC::new_client_connection(client_socket.release_nonnull(), client_id); }; - ASSERT(m_keyboard_fd >= 0); - ASSERT(m_mouse_fd >= 0); + if (m_keyboard_fd >= 0) { + m_keyboard_notifier = Core::Notifier::construct(m_keyboard_fd, Core::Notifier::Read); + m_keyboard_notifier->on_ready_to_read = [this] { drain_keyboard(); }; + } else { + dbgln("Couldn't open /dev/keyboard"); + } - m_keyboard_notifier = Core::Notifier::construct(m_keyboard_fd, Core::Notifier::Read); - m_keyboard_notifier->on_ready_to_read = [this] { drain_keyboard(); }; - - m_mouse_notifier = Core::Notifier::construct(m_mouse_fd, Core::Notifier::Read); - m_mouse_notifier->on_ready_to_read = [this] { drain_mouse(); }; + if (m_mouse_fd >= 0) { + m_mouse_notifier = Core::Notifier::construct(m_mouse_fd, Core::Notifier::Read); + m_mouse_notifier->on_ready_to_read = [this] { drain_mouse(); }; + } else { + dbgln("Couldn't open /dev/mouse"); + } } EventLoop::~EventLoop()