Index: src/instance.h ================================================================== --- src/instance.h +++ src/instance.h @@ -20,11 +20,11 @@ #ifdef __cplusplus extern "C" { #endif extern id objc_constructInstance(Class _Nullable, void *_Nullable); -extern void *objc_destructInstance(id); +extern void *objc_destructInstance(id _Nullable); #ifdef __cplusplus } #endif OF_ASSUME_NONNULL_END Index: src/instance.m ================================================================== --- src/instance.m +++ src/instance.m @@ -68,10 +68,13 @@ void * objc_destructInstance(id obj) { Class cls; void (*last)(id, SEL) = NULL; + + if (obj == nil) + return NULL; #ifdef OF_OBJFW_RUNTIME objc_zero_weak_references(obj); #endif