diff --git a/qglview/glmaterial.cpp b/qglview/glmaterial.cpp index f222137..4de1c94 100644 --- a/qglview/glmaterial.cpp +++ b/qglview/glmaterial.cpp @@ -134,7 +134,7 @@ GLuint GLTextureManagerBase::loadTexture(const QImage & im, bool ownership, bool void GLTextureManagerBase::reloadTexture(GLuint tid, const QString & path) { if (!currentGLTextureManager) return; QString p = findFile(path); - if (p.isEmpty()) return; + if (p.isEmpty() || (tid == 0)) return; QImage image(p); createGLTexture(tid, image); if (tid == 0) { @@ -147,7 +147,7 @@ void GLTextureManagerBase::reloadTexture(GLuint tid, const QString & path) { void GLTextureManagerBase::reloadTexture(GLuint tid, const QImage & im) { if (!currentGLTextureManager) return; - if (im.isNull()) return; + if (im.isNull() || (tid == 0)) return; QImage image(im); createGLTexture(tid, image); qDebug() << "[TextureManager] Reloaded" << tid;