summaryrefslogtreecommitdiff
path: root/include/com
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-07-03 08:23:39 +0200
committerStephan Bergmann <sbergman@redhat.com>2014-07-03 08:24:09 +0200
commit7bbaa39102367a42ba416db6a578718fc4e7bdf1 (patch)
tree84f96b45cd377bfb0f5101af23de39eaea8c80f6 /include/com
parentf36e64d8cc4a2fce8d84ef464a482445a8b8540a (diff)
Catch invalid null pointer operations early
Change-Id: I324d5a6e84e0d2121d8e4612e074b44ed5127b11
Diffstat (limited to 'include/com')
-rw-r--r--include/com/sun/star/uno/Reference.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/include/com/sun/star/uno/Reference.h b/include/com/sun/star/uno/Reference.h
index ec45f44ca39b..cedd4721cf18 100644
--- a/include/com/sun/star/uno/Reference.h
+++ b/include/com/sun/star/uno/Reference.h
@@ -19,8 +19,11 @@
#ifndef INCLUDED_COM_SUN_STAR_UNO_REFERENCE_H
#define INCLUDED_COM_SUN_STAR_UNO_REFERENCE_H
-#include <rtl/alloc.h>
+#include <sal/config.h>
+
+#include <cassert>
+#include <rtl/alloc.h>
namespace com
{
@@ -395,8 +398,10 @@ public:
@return UNacquired interface pointer
*/
- inline interface_type * SAL_CALL operator -> () const
- { return castFromXInterface(_pInterface); }
+ inline interface_type * SAL_CALL operator -> () const {
+ assert(_pInterface != 0);
+ return castFromXInterface(_pInterface);
+ }
/** Gets interface pointer. This call does not acquire the interface.