summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ganv/wrap.hpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/ganv/wrap.hpp b/ganv/wrap.hpp
index 26e04d1..4affe83 100644
--- a/ganv/wrap.hpp
+++ b/ganv/wrap.hpp
@@ -124,7 +124,11 @@ private: \
static inline const Ganv::Name* \
wrap(const Ganv##Name* gobj) \
{ \
- return wrap((Ganv##Name*)gobj); \
+ if (gobj) { \
+ return (const Ganv::Name*)ganv_item_get_wrapper(GANV_ITEM(gobj)); \
+ } else { \
+ return NULL; \
+ } \
} \
}