diff options
Diffstat (limited to 'include/tools/ref.hxx')
-rw-r--r-- | include/tools/ref.hxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/tools/ref.hxx b/include/tools/ref.hxx index 0bf519ecc094..87aed32048f2 100644 --- a/include/tools/ref.hxx +++ b/include/tools/ref.hxx @@ -19,6 +19,10 @@ #ifndef INCLUDED_TOOLS_REF_HXX #define INCLUDED_TOOLS_REF_HXX +#include <sal/config.h> + +#include <cassert> + #include <tools/toolsdllapi.h> #include <vector> @@ -59,9 +63,9 @@ public: T * operator &() const { return pObj; } - T * operator ->() const { return pObj; } + T * operator ->() const { assert(pObj != 0); return pObj; } - T & operator *() const { return *pObj; } + T & operator *() const { assert(pObj != 0); return *pObj; } operator T *() const { return pObj; } |