Skip to content

Commit ec2bc15

Browse files
authored
#1680 fix segmentation fault when appending None (#1778)
Signed-off-by: Spencer Magnusson <[email protected]>
1 parent 5dff8be commit ec2bc15

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/py-opentimelineio/opentimelineio-bindings/otio_serializableObjects.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -526,9 +526,9 @@ Should be subclassed (for example by :class:`.Track` and :class:`.Stack`), not u
526526
index = adjusted_vector_index(index, c->children());
527527
c->remove_child(index, ErrorStatusHandler());
528528
}, "index"_a)
529-
.def("__internal_insert", [](Composition* c, int index, Composable* composable) {
529+
.def("__internal_insert", [](Composition* c, int index, Composable &composable) {
530530
index = adjusted_vector_index(index, c->children());
531-
c->insert_child(index, composable, ErrorStatusHandler());
531+
c->insert_child(index, &composable, ErrorStatusHandler());
532532
}, "index"_a, "item"_a)
533533
.def("__contains__", &Composition::has_child, "composable"_a)
534534
.def("__len__", [](Composition* c) {

tests/test_track.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010

1111
class TrackTests(unittest.TestCase, otio_test_utils.OTIOAssertions):
1212

13+
def test_append_none(self):
14+
tr = otio.schema.Track()
15+
self.assertRaises(TypeError, lambda x: tr.append(None))
16+
1317
def test_find_children(self):
1418
cl = otio.schema.Clip()
1519
tr = otio.schema.Track()

0 commit comments

Comments
 (0)