diff --git a/libretroshare/src/serialiser/rsgxsiditems.h b/libretroshare/src/serialiser/rsgxsiditems.h index df8c936a5..a499b0c94 100644 --- a/libretroshare/src/serialiser/rsgxsiditems.h +++ b/libretroshare/src/serialiser/rsgxsiditems.h @@ -140,11 +140,21 @@ public: virtual uint32_t size (RsItem *item) { - return dynamic_cast(item)->serial_size() ; + RsGxsIdItem *idItem = dynamic_cast(item); + if (!idItem) + { + return 0; + } + return idItem->serial_size() ; } virtual bool serialise(RsItem *item, void *data, uint32_t *size) { - return dynamic_cast(item)->serialise(data,*size) ; + RsGxsIdItem *idItem = dynamic_cast(item); + if (!idItem) + { + return false; + } + return idItem->serialise(data,*size) ; } virtual RsItem *deserialise (void *data, uint32_t *size) ;