From e0c3e5ccfc06bfe4b460a804dab3bc078bf4e504 Mon Sep 17 00:00:00 2001 From: Squareys Date: Sat, 25 Aug 2018 20:47:40 +0200 Subject: [PATCH] Platform: gracefully fail GlfwApplication::exec() if no window was opened Signed-off-by: Squareys --- src/Magnum/Platform/GlfwApplication.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Magnum/Platform/GlfwApplication.cpp b/src/Magnum/Platform/GlfwApplication.cpp index f3b33d5a6..2b0e9baa1 100644 --- a/src/Magnum/Platform/GlfwApplication.cpp +++ b/src/Magnum/Platform/GlfwApplication.cpp @@ -436,6 +436,8 @@ void GlfwApplication::setSwapInterval(const Int interval) { } int GlfwApplication::exec() { + CORRADE_ASSERT(_window, "Platform::GlfwApplication::exec(): no window opened", {}); + while(!glfwWindowShouldClose(_window)) { if(_flags & Flag::Redraw) { _flags &= ~Flag::Redraw;