From a5f19e3f7270b335d324c4fa5a9ca33e59376ef0 Mon Sep 17 00:00:00 2001 From: Antonio Vazquez Date: Mon, 20 Jan 2020 16:18:04 +0100 Subject: Fix T73265: GPencil console error when delete frist frame --- source/blender/blenkernel/intern/gpencil.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'source/blender/blenkernel/intern/gpencil.c') diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c index 98c8f46970f..b1cf8ad8570 100644 --- a/source/blender/blenkernel/intern/gpencil.c +++ b/source/blender/blenkernel/intern/gpencil.c @@ -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 { -- cgit v1.2.3