summaryrefslogtreecommitdiff
path: root/pyuno/source
diff options
context:
space:
mode:
authorXiaoli <duan19002009@gmail.com>2013-06-16 15:31:00 +0200
committerMichael Stahl <mstahl@redhat.com>2013-06-16 15:29:04 +0000
commit7441d4bbdbbcb87193c32510f3577a0e531467e5 (patch)
tree598e7a6082838b8d9004ca5f1f3637b878dad681 /pyuno/source
parent51a35743271ea8ef390428d4f110c87e8318e675 (diff)
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@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'pyuno/source')
-rw-r--r--pyuno/source/module/pyuno_except.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/pyuno/source/module/pyuno_except.cxx b/pyuno/source/module/pyuno_except.cxx
index 9c21a9e65e4e..cf02bd007534 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 )