The rest of the code is checking programGuard for nullptr, do it here
as well to prevent a segmentation fault.
Change-Id: I38a03f74d493b8f731157be1739707b39904f7ba
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
{
Q_D(QOpenGLShaderProgram);
#ifndef QT_NO_DEBUG
- if (d->programGuard->group() != QOpenGLContextGroup::currentContextGroup())
+ if (d->programGuard && d->programGuard->group() != QOpenGLContextGroup::currentContextGroup())
qWarning("QOpenGLShaderProgram::release: program is not valid in the current context.");
#endif
d->glfuncs->glUseProgram(0);
{
#ifndef QT_NO_DEBUG
Q_D(QGLShaderProgram);
- if (d->programGuard->group() != QOpenGLContextGroup::currentContextGroup())
+ if (d->programGuard && d->programGuard->group() != QOpenGLContextGroup::currentContextGroup())
qWarning("QGLShaderProgram::release: program is not valid in the current context.");
#endif
#if defined(QT_OPENGL_ES_2)