Fix T73265: GPencil console error when delete frist frame

This commit is contained in:
Antonio Vazquez 2020-01-20 16:18:04 +01:00
parent 4dbaee0293
commit a5f19e3f72
Notes: blender-bot 2023-02-14 11:34:30 +01:00
Referenced by issue #73265, Grease Pencil Delete Active Frame operator throws error to console when first frame
Referenced by issue #71971, Inset with depth and offset relative has weird geometry and assert crash
1 changed files with 9 additions and 3 deletions

View File

@ -939,9 +939,15 @@ bGPDframe *BKE_gpencil_layer_getframe(bGPDlayer *gpl, int cframe, eGP_GetFrame_M
gpl->actframe = gpf;
}
else {
/* unresolved errogenous situation! */
CLOG_STR_ERROR(&LOG, "cannot find appropriate gp-frame");
/* gpl->actframe should still be NULL */
/* If delete first frame, need to find one. */
if (gpl->frames.first != NULL) {
gpl->actframe = gpl->frames.first;
}
else {
/* unresolved errogenous situation! */
CLOG_STR_ERROR(&LOG, "cannot find appropriate gp-frame");
/* gpl->actframe should still be NULL */
}
}
}
else {