From ce5b4cdba3fffac81bfa7ee4a3bffd99fe7f9935 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 7 Jun 2022 21:19:24 -0400 Subject: Make puglRealize() always gracefully fail with a bad configuration --- src/mac.m | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/mac.m') diff --git a/src/mac.m b/src/mac.m index 2a54134..4f5c08f 100644 --- a/src/mac.m +++ b/src/mac.m @@ -1007,10 +1007,15 @@ PuglStatus puglRealize(PuglView* view) { PuglInternals* impl = view->impl; + if (impl->wrapperView) { return PUGL_FAILURE; } + if (!view->backend || !view->backend->configure) { + return PUGL_BAD_BACKEND; + } + const NSScreen* const screen = [NSScreen mainScreen]; const double scaleFactor = [screen backingScaleFactor]; -- cgit v1.2.1