@@ -878,6 +878,7 @@ macro_rules! glib_object_wrapper {
878
878
#[ inline]
879
879
#[ allow( clippy:: cast_ptr_alignment) ]
880
880
unsafe fn from_glib_none( ptr: * mut $ffi_name) -> Self {
881
+ debug_assert!( !ptr. is_null( ) ) ;
881
882
debug_assert!( $crate:: types:: instance_of:: <Self >( ptr as * const _) ) ;
882
883
$name {
883
884
inner: $crate:: object:: TypedObjectRef :: new( $crate:: translate:: from_glib_none( ptr as * mut _) ) ,
@@ -891,6 +892,7 @@ macro_rules! glib_object_wrapper {
891
892
#[ inline]
892
893
#[ allow( clippy:: cast_ptr_alignment) ]
893
894
unsafe fn from_glib_none( ptr: * const $ffi_name) -> Self {
895
+ debug_assert!( !ptr. is_null( ) ) ;
894
896
debug_assert!( $crate:: types:: instance_of:: <Self >( ptr as * const _) ) ;
895
897
$name {
896
898
inner: $crate:: object:: TypedObjectRef :: new( $crate:: translate:: from_glib_none( ptr as * mut _) ) ,
@@ -904,6 +906,7 @@ macro_rules! glib_object_wrapper {
904
906
#[ inline]
905
907
#[ allow( clippy:: cast_ptr_alignment) ]
906
908
unsafe fn from_glib_full( ptr: * mut $ffi_name) -> Self {
909
+ debug_assert!( !ptr. is_null( ) ) ;
907
910
debug_assert!( $crate:: types:: instance_of:: <Self >( ptr as * const _) ) ;
908
911
$name {
909
912
inner: $crate:: object:: TypedObjectRef :: new( $crate:: translate:: from_glib_full( ptr as * mut _) ) ,
@@ -917,6 +920,7 @@ macro_rules! glib_object_wrapper {
917
920
#[ inline]
918
921
#[ allow( clippy:: cast_ptr_alignment) ]
919
922
unsafe fn from_glib_borrow( ptr: * mut $ffi_name) -> $crate:: translate:: Borrowed <Self > {
923
+ debug_assert!( !ptr. is_null( ) ) ;
920
924
debug_assert!( $crate:: types:: instance_of:: <Self >( ptr as * const _) ) ;
921
925
$crate:: translate:: Borrowed :: new(
922
926
$name {
0 commit comments