Don't crash if TileProvider cannot be created (closes #464)

This commit is contained in:
Alexander Bock
2018-11-21 15:21:40 -05:00
parent 1bb3c3ee27
commit d9b2c3ca96

View File

@@ -74,7 +74,13 @@ Layer* LayerManager::addLayer(layergroupid::GroupID groupId,
const ghoul::Dictionary& layerDict)
{
ghoul_assert(groupId != layergroupid::Unknown, "Layer group ID must be known");
return _layerGroups[groupId]->addLayer(layerDict);
try {
return _layerGroups[groupId]->addLayer(layerDict);
}
catch (const ghoul::RuntimeError& e) {
LERRORC(e.component, e.message);
return nullptr;
}
}
void LayerManager::deleteLayer(layergroupid::GroupID id, const std::string& layerName) {