Protect child_clip_id from accessing NULL parentClip property

This commit is contained in:
Jonathan Thomas
2023-04-13 15:03:25 -05:00
parent c472a2488d
commit def438dd0a

View File

@@ -383,9 +383,11 @@ void TrackedObjectBBox::SetJsonValue(const Json::Value root)
// Set the id of the child clip
if (!root["child_clip_id"].isNull() && root["child_clip_id"].asString() != "" && root["child_clip_id"].asString() != Id()){
Clip* parentClip = (Clip *) ParentClip();
if (root["child_clip_id"].asString() != parentClip->Id())
ChildClipId(root["child_clip_id"].asString());
if (parentClip && root["child_clip_id"].asString() != parentClip->Id()) {
ChildClipId(root["child_clip_id"].asString());
} else if (parentClip == NULL) {
ChildClipId(root["child_clip_id"].asString());
}
}
// Set the Keyframes by the given JSON object