Ignore NULL nodes in JSON arrays (clips, effects). This can happen sometimes (for an unknown reason), and it currently crashes OpenShot when attempting to Export a video.

This commit is contained in:
Jonathan Thomas
2023-10-07 15:19:36 -05:00
parent 95eccafc85
commit 4af80925b2
2 changed files with 15 additions and 0 deletions

View File

@@ -1040,6 +1040,11 @@ void Clip::SetJsonValue(const Json::Value root) {
// loop through effects
for (const auto existing_effect : root["effects"]) {
// Skip NULL nodes
if (existing_effect.isNull()) {
continue;
}
// Create Effect
EffectBase *e = NULL;
if (!existing_effect["type"].isNull()) {

View File

@@ -1193,6 +1193,11 @@ void Timeline::SetJsonValue(const Json::Value root) {
// loop through clips
for (const Json::Value existing_clip : root["clips"]) {
// Skip NULL nodes
if (existing_clip.isNull()) {
continue;
}
// Create Clip
Clip *c = new Clip();
@@ -1220,6 +1225,11 @@ void Timeline::SetJsonValue(const Json::Value root) {
// loop through effects
for (const Json::Value existing_effect :root["effects"]) {
// Skip NULL nodes
if (existing_effect.isNull()) {
continue;
}
// Create Effect
EffectBase *e = NULL;