Query::get_structure() can also return NULL

This commit is contained in:
Sebastian Dröge 2017-12-06 13:43:37 +02:00
parent 1f80df493a
commit 963557b79f

View file

@ -120,10 +120,14 @@ impl GstRc<QueryRef> {
}
impl QueryRef {
pub fn get_structure(&self) -> &StructureRef {
pub fn get_structure(&self) -> Option<&StructureRef> {
unsafe {
let structure = ffi::gst_query_get_structure(self.as_mut_ptr());
StructureRef::from_glib_borrow(structure)
if structure.is_null() {
None
} else {
Some(StructureRef::from_glib_borrow(structure))
}
}
}