From 66fd9bb8a28ea170522d1d50fc3c3c51bdfbbefb Mon Sep 17 00:00:00 2001 From: Marshall Hahn Date: Mon, 30 Sep 2013 14:11:37 -0400 Subject: [PATCH] fixed bad merge --- code/ObjExporter.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/ObjExporter.cpp b/code/ObjExporter.cpp index 6cc1063d2..bbf26ce56 100644 --- a/code/ObjExporter.cpp +++ b/code/ObjExporter.cpp @@ -59,10 +59,16 @@ void ExportSceneObj(const char* pFile,IOSystem* pIOSystem, const aiScene* pScene // we're still here - export successfully completed. Write both the main OBJ file and the material script { boost::scoped_ptr outfile (pIOSystem->Open(pFile,"wt")); + if(outfile == NULL) { + throw DeadlyExportError("could not open output .obj file: " + std::string(pFile)); + } outfile->Write( exporter.mOutput.str().c_str(), static_cast(exporter.mOutput.tellp()),1); } { boost::scoped_ptr outfile (pIOSystem->Open(exporter.GetMaterialLibFileName(),"wt")); + if(outfile == NULL) { + throw DeadlyExportError("could not open output .mtl file: " + std::string(exporter.GetMaterialLibFileName())); + } outfile->Write( exporter.mOutputMat.str().c_str(), static_cast(exporter.mOutputMat.tellp()),1); } }