From acb1e50cb4bb73f56bb093ab039420d8dd5930c9 Mon Sep 17 00:00:00 2001
From: Dmitrij Naumov <dmitrij@naumov.de>
Date: Fri, 12 Sep 2014 23:51:53 +0200
Subject: [PATCH] [A] Check if meshReader returned non-null ptr.

---
 Applications/ProjectData.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/Applications/ProjectData.cpp b/Applications/ProjectData.cpp
index 44d8f4d2385..c5c5b46ce89 100644
--- a/Applications/ProjectData.cpp
+++ b/Applications/ProjectData.cpp
@@ -51,7 +51,12 @@ ProjectData::ProjectData(ConfigTree const& project_config,
 	std::string const mesh_file = BaseLib::copyPathToFileName(
 			project_config.get<std::string>("mesh"), path
 		);
-	_mesh_vec.push_back(FileIO::readMeshFromFile(mesh_file));
+
+	MeshLib::Mesh* const mesh = FileIO::readMeshFromFile(mesh_file);
+	if (!mesh)
+		ERR("Could not read mesh from \'%s\' file. No mesh added.",
+			mesh_file.c_str());
+	_mesh_vec.push_back(mesh);
 
 	// process variables
 	parseProcessVariables(project_config.get_child("process_variables"));
-- 
GitLab