Skip to content

Commit 5a8fb61

Browse files
committed
Adding some protection around certain timeline JS bounding box operations (Sentry.io errors)
1 parent c0059bd commit 5a8fb61

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/timeline/js/controllers.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,9 @@ App.controller("TimelineCtrl", function ($scope) {
848848
timeline.add_missing_transition(JSON.stringify(missing_transition_details));
849849
}
850850
// Remove manual move stylesheet
851-
bounding_box.element.removeClass("manual-move");
851+
if (bounding_box.element) {
852+
bounding_box.element.removeClass("manual-move");
853+
}
852854

853855
// Remove CSS class (after the drag)
854856
bounding_box = {};
@@ -894,7 +896,7 @@ App.controller("TimelineCtrl", function ($scope) {
894896
bounding_box.track_position = 0;
895897

896898
// Set z-order to be above other clips/transitions
897-
if (item_type !== "os_drop") {
899+
if (item_type !== "os_drop" && bounding_box.element) {
898900
bounding_box.element.addClass("manual-move");
899901
}
900902
};
@@ -938,8 +940,10 @@ App.controller("TimelineCtrl", function ($scope) {
938940
}
939941
}
940942
//change the element location
941-
bounding_box.element.css("left", results.position.left);
942-
bounding_box.element.css("top", bounding_box.track_position - scrolling_tracks_offset_top);
943+
if (bounding_box.element) {
944+
bounding_box.element.css("left", results.position.left);
945+
bounding_box.element.css("top", bounding_box.track_position - scrolling_tracks_offset_top);
946+
}
943947
};
944948

945949
// Update X,Y indexes of tracks / layers (anytime the project.layers scope changes)

0 commit comments

Comments
 (0)