mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-17 15:36:45 +00:00
Error handling improvement
This commit is contained in:
parent
e642f20a65
commit
bd0233ce68
1 changed files with 6 additions and 0 deletions
|
@ -107,6 +107,12 @@ namespace Resource
|
||||||
if (extPos != std::string::npos && extPos+1 < normalized.size())
|
if (extPos != std::string::npos && extPos+1 < normalized.size())
|
||||||
ext = normalized.substr(extPos+1);
|
ext = normalized.substr(extPos+1);
|
||||||
osgDB::ReaderWriter* reader = osgDB::Registry::instance()->getReaderWriterForExtension(ext);
|
osgDB::ReaderWriter* reader = osgDB::Registry::instance()->getReaderWriterForExtension(ext);
|
||||||
|
if (!reader)
|
||||||
|
{
|
||||||
|
std::cerr << "Error loading " << filename << ": no readerwriter for '" << ext << "' found" << std::endl;
|
||||||
|
return mWarningTexture;
|
||||||
|
}
|
||||||
|
|
||||||
osgDB::ReaderWriter::ReadResult result = reader->readImage(*stream, opts);
|
osgDB::ReaderWriter::ReadResult result = reader->readImage(*stream, opts);
|
||||||
if (!result.success())
|
if (!result.success())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue