PVS: V522 There might be dereferencing of a potential null pointer 'Py::Vector2d().getCxxObject()'

This commit is contained in:
wmayer
2019-02-18 00:00:10 +01:00
parent 34da2b5d4f
commit 5d8cd9dba4
13 changed files with 61 additions and 51 deletions

View File

@@ -79,7 +79,7 @@ int Circle2dPy::PyInit(PyObject* args, PyObject* kwds)
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!d", keywords_cnr,
Base::Vector2dPy::type_object(), &pV1,
&dist)) {
Base::Vector2d v1 = Py::Vector2d(pV1).getCxxObject()->value();
Base::Vector2d v1 = Py::toVector2d(pV1);
GCE2d_MakeCircle mc(gp_Pnt2d(v1.x,v1.y), dist);
if (!mc.IsDone()) {
PyErr_SetString(PartExceptionOCCError, gce_ErrorStatusText(mc.Status()));
@@ -109,9 +109,9 @@ int Circle2dPy::PyInit(PyObject* args, PyObject* kwds)
Base::Vector2dPy::type_object(), &pV1,
Base::Vector2dPy::type_object(), &pV2,
Base::Vector2dPy::type_object(), &pV3)) {
Base::Vector2d v1 = Py::Vector2d(pV1).getCxxObject()->value();
Base::Vector2d v2 = Py::Vector2d(pV2).getCxxObject()->value();
Base::Vector2d v3 = Py::Vector2d(pV3).getCxxObject()->value();
Base::Vector2d v1 = Py::toVector2d(pV1);
Base::Vector2d v2 = Py::toVector2d(pV2);
Base::Vector2d v3 = Py::toVector2d(pV3);
GCE2d_MakeCircle mc(gp_Pnt2d(v1.x,v1.y),
gp_Pnt2d(v2.x,v2.y),
gp_Pnt2d(v3.x,v3.y));