From 3c4fe43fcc4c644c6cc366988a89b70321060ff6 Mon Sep 17 00:00:00 2001 From: Christopher Lackner Date: Thu, 18 Nov 2021 08:48:09 +0100 Subject: [PATCH] Fix loading of short mesh file names --- libsrc/meshing/python_mesh.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libsrc/meshing/python_mesh.cpp b/libsrc/meshing/python_mesh.cpp index 0d2af562..40d63e78 100644 --- a/libsrc/meshing/python_mesh.cpp +++ b/libsrc/meshing/python_mesh.cpp @@ -696,7 +696,7 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m) int strs; if( id == 0) { - if (filename.substr (filename.length()-8, 8) == ".vol.bin") + if (filename.length() > 8 && filename.substr (filename.length()-8, 8) == ".vol.bin") mesh -> Load(filename); else if (filename.substr (filename.length()-3, 3) == ".gz") infile = new igzstream (filename.c_str());