[Libreoffice-commits] core.git: pyuno/source
Xiaoli
duan19002009 at gmail.com
Sun Jun 16 08:29:27 PDT 2013
pyuno/source/module/pyuno_except.cxx | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
New commits:
commit 7441d4bbdbbcb87193c32510f3577a0e531467e5
Author: Xiaoli <duan19002009 at gmail.com>
Date: Sun Jun 16 15:31:00 2013 +0200
PyUno fixed crash in function isInstanceOfStructOrException()
when we try to call PyUNO_callable object that doesn't have __class__ attribute
Change-Id: Ia05f70d70f248d50aa141b09625f7ec50189e1dd
Reviewed-on: https://gerrit.libreoffice.org/4309
Reviewed-by: Michael Stahl <mstahl at redhat.com>
Tested-by: Michael Stahl <mstahl at redhat.com>
diff --git a/pyuno/source/module/pyuno_except.cxx b/pyuno/source/module/pyuno_except.cxx
index 9c21a9e..cf02bd0 100644
--- a/pyuno/source/module/pyuno_except.cxx
+++ b/pyuno/source/module/pyuno_except.cxx
@@ -200,8 +200,10 @@ bool isInstanceOfStructOrException( PyObject *obj)
PyRef attr(
PyObject_GetAttrString(obj, "__class__"),
SAL_NO_ACQUIRE );
- return PyObject_HasAttrString(
- attr.get(), "__pyunostruct__");
+ if(attr.is())
+ return PyObject_HasAttrString(attr.get(), "__pyunostruct__");
+ else
+ return false;
}
sal_Bool isInterfaceClass( const Runtime &runtime, PyObject * obj )
More information about the Libreoffice-commits
mailing list