Skip to content

Commit

Permalink
Update paintsettingsanimator.cpp
Browse files Browse the repository at this point in the history
Make sure we actually have a gradient before using it.

Ref: #231
  • Loading branch information
rodlie committed Aug 31, 2024
1 parent a5fd62e commit 915353a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/core/Animators/paintsettingsanimator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,12 @@ void PaintSettingsAnimator::prp_readProperty_impl(eReadStream& src)
gradient = parentScene->getGradientWithDocumentId(gradDocId);
if (!gradient) { // gradient is in a different scene
gradient = parentScene->getGradientWithDocumentSceneId(gradDocId);
const auto newGrad = parentScene->createNewGradient();
const auto clipboard = enve::make_shared<PropertyClipboard>(gradient);
clipboard->paste(newGrad);
gradient = newGrad;
if (gradient) {
const auto newGrad = parentScene->createNewGradient();
const auto clipboard = enve::make_shared<PropertyClipboard>(gradient);
clipboard->paste(newGrad);
gradient = newGrad;
}
}
}
setGradientVar(gradient);
Expand Down

0 comments on commit 915353a

Please sign in to comment.