From 1b9c26d0e28bf5eeab864099bc422444bc439fd3 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 2 Jan 2023 17:04:08 -0500 Subject: Ensure that views have an event handler set Otherwise, there will be crashes in the implementation. --- src/internal.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/internal.c b/src/internal.c index bc5080f..2f277bb 100644 --- a/src/internal.c +++ b/src/internal.c @@ -109,6 +109,11 @@ puglPreRealize(PuglView* const view) return PUGL_BAD_BACKEND; } + // Ensure that the view has an event handler + if (!view->eventFunc) { + return PUGL_BAD_CONFIGURATION; + } + // Set the size to the default if it hasn't already been set if (!isValidSize(view->frame.width, view->frame.height)) { const PuglViewSize defaultSize = view->sizeHints[PUGL_DEFAULT_SIZE]; -- cgit v1.2.1