Warn user if cannot evaluate model's textures property

This commit is contained in:
David Rowe 2016-01-07 16:47:48 +13:00
parent a3ceb3a298
commit f64481c510

View file

@ -129,7 +129,11 @@ void RenderableModelEntityItem::remapTextures() {
QJsonObject currentTexturesAsJsonObject = currentTexturesAsJson.object();
QVariantMap currentTextureMap = currentTexturesAsJsonObject.toVariantMap();
QJsonDocument texturesAsJson = QJsonDocument::fromJson(_textures.toUtf8());
QJsonParseError error;
QJsonDocument texturesAsJson = QJsonDocument::fromJson(_textures.toUtf8(), &error);
if (error.error != QJsonParseError::NoError) {
qCWarning(entitiesrenderer) << "Could not evaluate textures property:" << _textures;
}
QJsonObject texturesAsJsonObject = texturesAsJson.object();
QVariantMap textureMap = texturesAsJsonObject.toVariantMap();