From ab7d2a4bcc63b55bcd894430d78849f8ecf45519 Mon Sep 17 00:00:00 2001 From: ThorstenB Date: Mon, 30 Apr 2012 18:29:44 +0200 Subject: [PATCH] Allow "texture-path" XML entries to be present but empty. This had worked with previous FG versions and is used by many models - so it shouldn't be treated as an error now. --- simgear/scene/model/SGReaderWriterXML.cxx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/simgear/scene/model/SGReaderWriterXML.cxx b/simgear/scene/model/SGReaderWriterXML.cxx index 50943dcd..5a4356bb 100644 --- a/simgear/scene/model/SGReaderWriterXML.cxx +++ b/simgear/scene/model/SGReaderWriterXML.cxx @@ -247,10 +247,13 @@ sgLoad3DModel_internal(const SGPath& path, if (props->hasValue("/texture-path")) { string texturePathStr = props->getStringValue("/texture-path"); - texturepath = SGModelLib::findDataFile(texturePathStr, NULL, modelDir); - if (texturepath.isNull()) - throw sg_io_exception("Texture file not found: '" + texturePathStr + "'", - path.str()); + if (!texturePathStr.empty()) + { + texturepath = SGModelLib::findDataFile(texturePathStr, NULL, modelDir); + if (texturepath.isNull()) + throw sg_io_exception("Texture file not found: '" + texturePathStr + "'", + path.str()); + } } } else { model = new osg::Node; -- 2.39.5