From 48a4e5a396d5e29ac333d45f745fba58eb04045b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matt=C3=A9o=20Delabre?= Date: Sat, 24 Apr 2021 22:28:31 +0200 Subject: [PATCH] Fix invalid optional access with --no-pen flag --- src/app/client.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/client.cpp b/src/app/client.cpp index 7b8fa7d..73fb936 100644 --- a/src/app/client.cpp +++ b/src/app/client.cpp @@ -190,7 +190,8 @@ auto client::event_loop() -> bool handle_status(this->pen_handler->process_events()); } - bool inhibit = this->pen_handler->is_inhibiting(); + bool inhibit = this->pen_handler.has_value() + && this->pen_handler->is_inhibiting(); if (this->buttons_handler.has_value() // NOLINTNEXTLINE(hicpp-signed-bitwise): Use of C library