check for valid resource pointer before use

This commit is contained in:
Andrew Meadows 2017-05-18 15:12:59 -07:00
parent 8d3285f733
commit 17b6cf29df

View file

@ -810,8 +810,10 @@ void Model::setURL(const QUrl& url) {
deleteGeometry();
auto resource = DependencyManager::get<ModelCache>()->getGeometryResource(url);
resource->setLoadPriority(this, _loadingPriority);
_renderWatcher.setResource(resource);
if (resource) {
resource->setLoadPriority(this, _loadingPriority);
_renderWatcher.setResource(resource);
}
onInvalidate();
}