diff options
author | David Robillard <d@drobilla.net> | 2023-01-02 17:04:08 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2023-01-02 17:04:08 -0500 |
commit | 1b9c26d0e28bf5eeab864099bc422444bc439fd3 (patch) | |
tree | 10c25a3ac09b333920644517d53190d03f6f0c26 | |
parent | 2eb319fbef4c611387f421afab0f8ccefbc298cf (diff) | |
download | pugl-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.
-rw-r--r-- | src/internal.c | 5 |
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]; |