Don't resolve the empty file name, which would result in the fgdata
directory path (instead of a path to a file). Eventually this resulted in
a segfault, partly due to a bug in "osgDB::readImageFile", which reports
"success" when given a directory (instead of a file) path, though it
doesn't return a valid image object.
if (pImage)
{
imageName = pImage->getStringValue();
- absFileName = SGModelLib::findDataFile(imageName, options);
- if (absFileName.empty())
+ if (!imageName.empty())
{
- SG_LOG(SG_INPUT, SG_ALERT, "Texture file not found: '"
- << imageName << "'");
+ absFileName = SGModelLib::findDataFile(imageName, options);
+ if (absFileName.empty())
+ {
+ SG_LOG(SG_INPUT, SG_ALERT, "Texture file not found: '"
+ << imageName << "'");
+ }
}
}