From 8f08e7ecb59bd7c6ea9633f016dd4b13a054bee8 Mon Sep 17 00:00:00 2001
From: Thomas Fischer <thomas.fischer@ufz.de>
Date: Tue, 12 Mar 2019 09:53:11 +0100
Subject: [PATCH] [A/U/ME] Fix bugs in ResetPropertiesInPolygonalRegion.

- remove the twice given command line argument -g
- check if mesh is read
---
 .../Utils/MeshEdit/ResetPropertiesInPolygonalRegion.cpp    | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/Applications/Utils/MeshEdit/ResetPropertiesInPolygonalRegion.cpp b/Applications/Utils/MeshEdit/ResetPropertiesInPolygonalRegion.cpp
index ab92bc16ab7..1fecc91a9da 100644
--- a/Applications/Utils/MeshEdit/ResetPropertiesInPolygonalRegion.cpp
+++ b/Applications/Utils/MeshEdit/ResetPropertiesInPolygonalRegion.cpp
@@ -73,7 +73,7 @@ int main (int argc, char* argv[])
         "the name of the file containing the input mesh", true,
         "", "file name");
     cmd.add(mesh_in);
-    TCLAP::ValueArg<std::string> gmsh_path_arg("g", "gmsh-path",
+    TCLAP::ValueArg<std::string> gmsh_path_arg("", "gmsh-path",
                                                "the path to the gmsh binary",
                                                false, "", "path as string");
     cmd.add(gmsh_path_arg);
@@ -124,6 +124,11 @@ int main (int argc, char* argv[])
     // *** read mesh
     auto mesh = std::unique_ptr<MeshLib::Mesh>(
         MeshLib::IO::readMeshFromFile(mesh_in.getValue()));
+    if (!mesh)
+    {
+        // error message written already by readMeshFromFile
+        return EXIT_FAILURE;
+    }
     std::string const& property_name(property_name_arg.getValue());
 
     if (char_property_arg.isSet()) {
-- 
GitLab