diff --git a/gst/gst_structure.go b/gst/gst_structure.go index 78f2c8a..05f6c3f 100644 --- a/gst/gst_structure.go +++ b/gst/gst_structure.go @@ -202,10 +202,13 @@ func (s *Structure) ToGValue() (*glib.Value, error) { return nil, err } - C.gst_value_set_structure( - (*C.GValue)(unsafe.Pointer(val.GValue)), - s.copy(), - ) + if s != nil { + C.gst_value_set_structure( + (*C.GValue)(unsafe.Pointer(val.GValue)), + s.copy(), + ) + } + return val, nil }