Documentation of g_set_object(): can object_ptr be null?
The documentation of g_set_object() says:
It decrements the reference count of the current value of object_ptr (if non-NULL). object_ptr must not be NULL.
The parameters description of object_ptr contains no annotatations or statements, whether object_ptr can be null.
The statement, that the reference count of object_ptr is decremented (if non-NULL) and object_ptr must not be NULL is unclear.