- (let* ((info (g-boxed-foreign-info type)))
- (cond
- ((g-boxed-foreign-for-callback type)
- (create-reference-proxy info native-structure))
- ((or (g-boxed-foreign-free-to-foreign type)
- (g-boxed-foreign-free-from-foreign type))
- (error "Feature not yet handled"))
- (t (create-proxy-for-native info native-structure)))))
+ (unless (null-pointer-p native-structure)
+ (let* ((info (g-boxed-foreign-info type)))
+ (cond
+ ((g-boxed-foreign-for-callback type)
+ (create-reference-proxy info native-structure))
+ ((or (g-boxed-foreign-free-to-foreign type)
+ (g-boxed-foreign-free-from-foreign type))
+ (error "Feature not yet handled"))
+ (t (create-proxy-for-native info native-structure))))))