Skip to content

Commit

Permalink
Protect calls to ParentClipProperties
Browse files Browse the repository at this point in the history
  • Loading branch information
jonoomph committed Apr 13, 2023
1 parent b6c07d3 commit 32556d5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Clip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ std::string Clip::PropertiesJSON(int64_t requested_frame) const {
root["waveform"]["choices"].append(add_property_choice_json("No", false, waveform));

// Add the parentTrackedObject's properties
if (parentTrackedObject)
if (parentTrackedObject && parentClipObject)
{
// Convert Clip's frame position to Timeline's frame position
long clip_start_position = round(Position() * info.fps.ToDouble()) + 1;
Expand Down Expand Up @@ -1445,7 +1445,10 @@ QTransform Clip::get_transform(std::shared_ptr<Frame> frame, int width, int heig
double timeline_frame_number = frame->number + clip_start_position - clip_start_frame;

// Get parentTrackedObject's parent clip's properties
std::map<std::string, float> trackedObjectParentClipProperties = parentTrackedObject->GetParentClipProperties(timeline_frame_number);
std::map<std::string, float> trackedObjectParentClipProperties;
if (parentClipObject) {
parentTrackedObject->GetParentClipProperties(timeline_frame_number);
}

// Get the attached object's parent clip's properties
if (!trackedObjectParentClipProperties.empty())
Expand Down

0 comments on commit 32556d5

Please sign in to comment.