From bb0fe3975df149eb45a21e39940f71e2273c8fd5 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 8 Jun 2022 19:47:57 -0400 Subject: Fix potential null pointer dereference According to clang-tidy anyway, I'm not seeing it. --- src/x11.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/x11.c b/src/x11.c index c7fdad2..deae154 100644 --- a/src/x11.c +++ b/src/x11.c @@ -1403,7 +1403,7 @@ dispatchX11Events(PuglWorld* const world) continue; } - PuglView* view = findView(world, xevent.xany.window); + PuglView* const view = findView(world, xevent.xany.window); if (!view) { continue; } @@ -1448,14 +1448,14 @@ dispatchX11Events(PuglWorld* const world) break; case PUGL_FOCUS_IN: // Set the input context focus - if (impl->xic) { - XSetICFocus(impl->xic); + if (view->impl->xic) { + XSetICFocus(view->impl->xic); } break; case PUGL_FOCUS_OUT: // Unset the input context focus - if (impl->xic) { - XUnsetICFocus(impl->xic); + if (view->impl->xic) { + XUnsetICFocus(view->impl->xic); } break; default: -- cgit v1.2.1