mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
Cleanup: Avoid possible NULL pointer error
In normal conditions, `gpf` always has a value, but better move inside the NULL checking.
This commit is contained in:
parent
b3fe135854
commit
822501d86d
1 changed files with 3 additions and 2 deletions
|
|
@ -476,9 +476,10 @@ bool ED_gpencil_anim_copybuf_paste(bAnimContext *ac, const short offset_mode)
|
|||
|
||||
/* get frame to copy data into (if no frame returned, then just ignore) */
|
||||
gpf = BKE_gpencil_layer_frame_get(gpld, gpfs->framenum, GP_GETFRAME_ADD_NEW);
|
||||
/* Ensure to use same keyframe type. */
|
||||
gpf->key_type = gpfs->key_type;
|
||||
if (gpf) {
|
||||
/* Ensure to use same keyframe type. */
|
||||
gpf->key_type = gpfs->key_type;
|
||||
|
||||
bGPDstroke *gps, *gpsn;
|
||||
|
||||
/* This should be the right frame... as it may be a pre-existing frame,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue