Add a check for the resule of a dynamic cast.
parent
c1dc3901e7
commit
f5e94a2840
|
@ -28,7 +28,11 @@ namespace Assimp {
|
|||
|
||||
#define IMPL_STRUCT_READ(ty) \
|
||||
bool read##ty(ElemBase *v, const size_t cnt, const FileDatabase &db) { \
|
||||
return read<ty>(db.dna[#ty], dynamic_cast<ty *>(v), cnt, db); \
|
||||
ty *ptr = dynamic_cast<ty*>(v); \
|
||||
if (nullptr == ptr) { \
|
||||
return false; \
|
||||
} \
|
||||
return read<ty>(db.dna[#ty], ptr, cnt, db); \
|
||||
}
|
||||
|
||||
#define IMPL_STRUCT_CREATE(ty) \
|
||||
|
|
Loading…
Reference in New Issue