From 402aca93afbfb1bd1ffdee805f08b06c41e9b120 Mon Sep 17 00:00:00 2001 From: wmayer Date: Fri, 3 Jan 2020 16:14:55 +0100 Subject: [PATCH] [skip ci] issue #0004164, issue #0004237: macOS crash when opening project from 'Recent files' --- src/Gui/Quarter/QuarterWidget.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Gui/Quarter/QuarterWidget.cpp b/src/Gui/Quarter/QuarterWidget.cpp index 7d3addb303..f06dd0f73e 100644 --- a/src/Gui/Quarter/QuarterWidget.cpp +++ b/src/Gui/Quarter/QuarterWidget.cpp @@ -886,7 +886,11 @@ void QuarterWidget::paintEvent(QPaintEvent* event) glMatrixMode(GL_PROJECTION); QtGLWidget* w = static_cast(this->viewport()); - assert(w->isValid() && "No valid GL context found!"); + if (!w->isValid()) { + qWarning() << "No valid GL context found!"; + return; + } + //assert(w->isValid() && "No valid GL context found!"); // We might have to process the delay queue here since we don't know // if paintGL() is called from Qt, and we might have some sensors // waiting to trigger (the redraw sensor has a lower priority than a