Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Vazquez <blendergit@gmail.com>2020-08-18 09:36:26 +0300
committerAntonio Vazquez <blendergit@gmail.com>2020-08-18 09:36:26 +0300
commitf94e322ab7f480342b12d7c65406216ca4eed067 (patch)
treee24151160bec91ea1bc9f9d02da8b6360ee28701 /source/blender
parentd1057890c40b6f50d0a13215eec90ab1af03a44b (diff)
Fix T79770: Crash opening 2.83 .blend with linked collection containing greasepencil object in 2.91
The scene was null and could not be patched.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenloader/intern/versioning_290.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/source/blender/blenloader/intern/versioning_290.c b/source/blender/blenloader/intern/versioning_290.c
index a96b82e2e91..aef2a59580c 100644
--- a/source/blender/blenloader/intern/versioning_290.c
+++ b/source/blender/blenloader/intern/versioning_290.c
@@ -188,17 +188,19 @@ void do_versions_after_linking_290(Main *bmain, ReportList *UNUSED(reports))
/* Patch first frame for old files. */
Scene *scene = bmain->scenes.first;
- LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
- if (ob->type != OB_GPENCIL) {
- continue;
- }
- bGPdata *gpd = ob->data;
- LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
- bGPDframe *gpf = gpl->frames.first;
- if (gpf && gpf->framenum > scene->r.sfra) {
- bGPDframe *gpf_dup = BKE_gpencil_frame_duplicate(gpf);
- gpf_dup->framenum = scene->r.sfra;
- BLI_addhead(&gpl->frames, gpf_dup);
+ if (scene != NULL) {
+ LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
+ if (ob->type != OB_GPENCIL) {
+ continue;
+ }
+ bGPdata *gpd = ob->data;
+ LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
+ bGPDframe *gpf = gpl->frames.first;
+ if (gpf && gpf->framenum > scene->r.sfra) {
+ bGPDframe *gpf_dup = BKE_gpencil_frame_duplicate(gpf);
+ gpf_dup->framenum = scene->r.sfra;
+ BLI_addhead(&gpl->frames, gpf_dup);
+ }
}
}
}