There is g_assert_nonnull(), however that doesn't return the pointer. Returning the pointer can be convenient...