From cb2160449412b6470996a2b9b4a4a8ed172d6717 Mon Sep 17 00:00:00 2001 From: Syres916 <46537884+Syres916@users.noreply.github.com> Date: Mon, 20 Mar 2023 14:00:34 +0000 Subject: [PATCH] [App] Minor improvment to error handling for... ... a rare event, see https://forum.freecad.org/viewtopic.php?t=76947 --- src/App/PropertyPythonObject.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/App/PropertyPythonObject.cpp b/src/App/PropertyPythonObject.cpp index edf46f20c91f..c1c364d5bbfa 100644 --- a/src/App/PropertyPythonObject.cpp +++ b/src/App/PropertyPythonObject.cpp @@ -121,6 +121,11 @@ void PropertyPythonObject::fromString(const std::string& repr) try { if (repr.empty()) return; + if (repr == "null") { + Py::String typestr(this->object.type().str()); + Base::Console().Log("PropertyPythonObject::fromString(): repr is null for object %s\n", typestr.as_string().c_str()); + return; + } Py::Module pickle(PyImport_ImportModule("json"),true); if (pickle.isNull()) throw Py::Exception();