Skip to content

Commit 9401749

Browse files
authored
Merge pull request #5556 from OpenShot/sentry-20240627
Fixing many misc Sentry reports on OpenShot 3.2
2 parents 98d0ae3 + ada1d05 commit 9401749

File tree

5 files changed

+15
-3
lines changed

5 files changed

+15
-3
lines changed

src/classes/waveform.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def getAudioData(file, channel=-1, tid=None):
112112
file = File.get(id=file_id)
113113

114114
# Only generate audio for readers that actually contain audio
115-
if not file.data.get("has_audio", False):
115+
if not file or not file.data.get("has_audio", False):
116116
log.info("File does not have audio. Skipping")
117117
return
118118

@@ -163,6 +163,9 @@ def getAudioData(file, channel=-1, tid=None):
163163
# Loop through samples from the file, applying this clip's volume curve
164164
clip_audio_data = []
165165
clip_instance = get_app().window.timeline_sync.timeline.GetClip(clip.id)
166+
if not clip_instance:
167+
log.info("Clip not found, bailing out of waveform volume adjustments")
168+
continue
166169
num_frames = clip_instance.info.video_length
167170

168171
# Determine best guess # of samples (based on duration)

src/timeline/js/controllers.js

+5
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,11 @@ App.controller("TimelineCtrl", function ($scope) {
688688
* @return {string}
689689
*/
690690
$scope.getThumbPath = function (clip) {
691+
if (!clip || !clip.reader) {
692+
console.error("Invalid clip object or missing reader property in getThumbPath");
693+
return "../images/NotFound.svg";
694+
}
695+
691696
var has_video = clip["reader"]["has_video"];
692697
var has_audio = clip["reader"]["has_audio"];
693698
if (!has_video && has_audio) {

src/windows/add_to_timeline.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ def accept(self):
326326
# Add transition for this clip (if any)
327327
# Open up QtImageReader for transition Image
328328
if random_transition:
329-
random_index = randint(0, len(self.transitions))
329+
random_index = randint(0, len(self.transitions) - 1)
330330
transition_path = self.transitions[random_index]
331331

332332
# Get reader for transition

src/windows/models/properties_model.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ def value_updated(self, item, interpolation=-1, value=None, interpolation_detail
518518
# Keyframe
519519

520520
# Protection from HUGE scale values
521-
if property_key in ['scale_x', 'scale_y', 'shear_x', 'shear_y']:
521+
if property_key in ['scale_x', 'scale_y', 'shear_x', 'shear_y'] and new_value:
522522
width = get_app().project.get("width")
523523
height = get_app().project.get("height")
524524
is_svg = clip_data.get("reader", {}).get("path", "").lower().endswith("svg")

src/windows/video_widget.py

+4
Original file line numberDiff line numberDiff line change
@@ -1436,6 +1436,10 @@ def __init__(self, watch_project=True, *args):
14361436
self.leftHandle = None
14371437
self.rightHandle = None
14381438
self.centerHandle = None
1439+
self.topShearHandle = None
1440+
self.leftShearHandle = None
1441+
self.rightShearHandle = None
1442+
self.bottomShearHandle = None
14391443
self.clipBounds = None
14401444
self.originHandle = None
14411445
self.mouse_pressed = False

0 commit comments

Comments
 (0)