summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Ottens <kevin.ottens@kdab.com>2016-08-22 08:50:52 +0200
committerSean Harmer <sean.harmer@kdab.com>2016-08-24 19:33:07 +0000
commit3a33deb273e096b9a5fdb07941efa14fa3f5b91b (patch)
tree7caea990e6c776184b943d705bd41ab1cf64a0ad
parentffface42ec928185ef18fcd49285114469a02223 (diff)
LoadTextureDataJob: No crash on null texture data
This way we issue a warning but don't crash when a texture didn't load properly. Change-Id: Iec83fbfcdc77990a7350f1d2cbf75c69f8705fbe Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r--src/render/jobs/loadtexturedatajob.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/render/jobs/loadtexturedatajob.cpp b/src/render/jobs/loadtexturedatajob.cpp
index e68717062..b8663e4a7 100644
--- a/src/render/jobs/loadtexturedatajob.cpp
+++ b/src/render/jobs/loadtexturedatajob.cpp
@@ -204,7 +204,8 @@ void LoadTextureDataJob::run()
// Set the textureDataHandle on the texture image
// Note: this internally updates the DNA of the TextureImage
texImg->setTextureDataHandle(textureDataHandle);
- texImg->updateDNA(::qHash(QTextureImageDataPrivate::get(data)->m_data));
+ if (data)
+ texImg->updateDNA(::qHash(QTextureImageDataPrivate::get(data)->m_data));
}
}
// Tell the renderer to reload/upload to GPU the TextureImage for the Texture