Fix bug that caused black screen when unable to load gdal dataset.

This commit is contained in:
Kalle Bladin
2016-09-15 12:49:34 -04:00
parent 5cf9a89223
commit f9e88fb40c

View File

@@ -133,11 +133,20 @@ namespace openspace {
std::string type = "LRUCaching"; // if type is unspecified
texDict.getValue("Type", type);
TileProvider* tileProvider;
auto tileProviderFactory = FactoryManager::ref().factory<TileProvider>();
TileProvider* tileProvider = tileProviderFactory->create(type, texDict);
try {
tileProvider = tileProviderFactory->create(type, texDict);
}
catch (const ghoul::RuntimeError& e) {
LERROR(e.what());
continue;
}
// Something else went wrong and no exception was thrown
if (tileProvider == nullptr) {
LERROR("Unable to create TileProvider '" << name << "' of type '" << type << "'");
LERROR("Unable to create TileProvider '" << name << "' of type '"
<< type << "'");
continue;
}