aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2023-01-02 17:04:08 -0500
committerDavid Robillard <d@drobilla.net>2023-01-02 17:04:08 -0500
commit1b9c26d0e28bf5eeab864099bc422444bc439fd3 (patch)
tree10c25a3ac09b333920644517d53190d03f6f0c26 /src
parent2eb319fbef4c611387f421afab0f8ccefbc298cf (diff)
downloadpugl-1b9c26d0e28bf5eeab864099bc422444bc439fd3.tar.gz
pugl-1b9c26d0e28bf5eeab864099bc422444bc439fd3.tar.bz2
pugl-1b9c26d0e28bf5eeab864099bc422444bc439fd3.zip
Ensure that views have an event handler set
Otherwise, there will be crashes in the implementation.
Diffstat (limited to 'src')
-rw-r--r--src/internal.c5
1 files changed, 5 insertions, 0 deletions
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];