Closed saivert closed 1 year ago
I pushed a corrected return type that should now catch null values as None
, let me know if you still encounter problems.
Maybe it is better if the return type is simply
Option<(glib::GString, glib::GString)>
since the whole thing is either valid or not.
This part is now being tracked as part of #13; there are a number of functions with awkward return types that need cleaning up.
Give this code:
This always leads to a assert failure in
from_glib_full
where it looks like the pointer is always null.I tried fixing it like this:
But then I get this error:
I think this is the correct way to fix it:
Not valid to try to get the type name unless you actually find a metadata item and also not valid if the type is a null pointer. This should handle both cases.
Maybe it is better if the return type is simply
Option<(glib::GString, glib::GString)>
since the whole thing is either valid or not.Yes I'm not decided on whether this code should use MaybeUninit instead. I was trying to fix this code using as few modifications to the existing code as possible.