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

View File

@@ -938,12 +938,18 @@ bGPDframe *BKE_gpencil_layer_getframe(bGPDlayer *gpl, int cframe, eGP_GetFrame_M
else if (found) {
gpl->actframe = gpf;
}
else {
/* 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 {
/* currently no frames (add if allowed to) */
if (addnew) {