make sure request is not nullptr before using it

This commit is contained in:
Stephen Birarda 2015-10-13 16:49:12 -07:00
parent d22c602041
commit 574089530a

View file

@ -96,6 +96,7 @@ void ATPAssetMigrator::loadEntityServerFile() {
} else if (wantsToMigrateResource(modelURL)) {
auto request = ResourceManager::createResourceRequest(this, modelURL);
if (request) {
qCDebug(asset_migrator) << "Requesting" << modelURL << "for ATP asset migration";
// add this combination of QUrl and QJsonValueRef to our multi hash so we can change the URL
@ -107,13 +108,17 @@ void ATPAssetMigrator::loadEntityServerFile() {
migrateResource(request);
} else {
QMessageBox::warning(_dialogParent, "Error",
QString("Could not retreive asset at %1").arg(modelURL.toString()));
QString("Could not retrieve asset at %1").arg(modelURL.toString()));
}
request->deleteLater();
});
request->send();
} else {
QMessageBox::warning(_dialogParent, "Error",
QString("Could not create request for asset at %1").arg(modelURL.toString()));
}
} else {
_ignoredUrls.insert(modelURL);
}