From 6d1785a5ebabc41d0808e43dfd145a65e6a462d8 Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 19 Jun 2019 17:31:50 +0200 Subject: [PATCH] Fix crash in case encoding of Python paths fails --- src/App/Application.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/App/Application.cpp b/src/App/Application.cpp index 86aadebd17..f58785cee3 100644 --- a/src/App/Application.cpp +++ b/src/App/Application.cpp @@ -1529,7 +1529,11 @@ void Application::initConfig(int argc, char ** argv) PyImport_AppendInittab ("FreeCAD", init_freecad_module); PyImport_AppendInittab ("__FreeCADBase__", init_freecad_base_module); #endif - mConfig["PythonSearchPath"] = Interpreter().init(argc,argv); + const char* pythonpath = Interpreter().init(argc,argv); + if (pythonpath) + mConfig["PythonSearchPath"] = pythonpath; + else + Base::Console().Warning("Encoding of Python paths failed\n"); // Parse the options that have impact on the init process ParseOptions(argc,argv);