mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-21 11:39:51 -06:00
Prevent program crash when unable to open dataset
This commit is contained in:
@@ -210,7 +210,7 @@ namespace openspace {
|
||||
result->dimensions = glm::uvec3(io.write.region.numPixels, 1);
|
||||
result->nBytesImageData = io.write.totalNumBytes;
|
||||
|
||||
if (_doPreprocessing) {
|
||||
if (_config.doPreProcessing) {
|
||||
result->preprocessData = preprocess(result, io.write.region);
|
||||
result->error = std::max(result->error, postProcessErrorCheck(result, io));
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ namespace openspace {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
// Initialization //
|
||||
//////////////////////////////////////////////////////////////////////////////////\
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void initialize();
|
||||
void ensureInitialized();
|
||||
@@ -181,8 +181,6 @@ namespace openspace {
|
||||
TileDepthTransform _depthTransform;
|
||||
TileDataLayout _dataLayout;
|
||||
|
||||
bool _doPreprocessing;
|
||||
|
||||
static bool GdalHasBeenInitialized;
|
||||
bool hasBeenInitialized;
|
||||
};
|
||||
|
||||
@@ -62,7 +62,19 @@ namespace openspace {
|
||||
LERROR("Unknown type: " << type);
|
||||
return nullptr;
|
||||
}
|
||||
return concreteFactoryIterator->second(desc, initData);
|
||||
|
||||
std::shared_ptr<TileProvider> tileProvider;
|
||||
|
||||
try {
|
||||
tileProvider = concreteFactoryIterator->second(desc, initData);
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
LERROR(e.what());
|
||||
}
|
||||
catch (...) {
|
||||
LERROR("Could not open dataset:\n" << desc << "\n");
|
||||
}
|
||||
return tileProvider;
|
||||
}
|
||||
|
||||
void TileProviderFactory::initialize() {
|
||||
|
||||
Reference in New Issue
Block a user