From a19da3e4e3efb35dfc9bbbef414c83daac829f9b Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 28 Apr 2013 14:30:25 +0200 Subject: [PATCH] Fix possible crash in PropertyEnumeration class --- src/App/PropertyStandard.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/App/PropertyStandard.cpp b/src/App/PropertyStandard.cpp index f777c8d2ba..fb73ec4d0c 100644 --- a/src/App/PropertyStandard.cpp +++ b/src/App/PropertyStandard.cpp @@ -467,7 +467,7 @@ void PropertyEnumeration::setPyObject(PyObject *value) { if (PyInt_Check(value)) { long val = PyInt_AsLong(value); - if(_EnumArray){ + if (_EnumArray) { const char** plEnums = _EnumArray; long i=0; while(*(plEnums++) != NULL)i++; @@ -478,10 +478,10 @@ void PropertyEnumeration::setPyObject(PyObject *value) } else if (PyString_Check(value)) { const char* str = PyString_AsString (value); - if (isPartOf(str)) + if (_EnumArray && isPartOf(str)) setValue(PyString_AsString (value)); else - throw Py::ValueError("not a member of the enum"); + throw Py::ValueError("not part of the enum"); } else if (PyList_Check(value)) { Py_ssize_t nSize = PyList_Size(value);