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>2022-01-18 15:44:27 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2022-02-22 13:06:40 +0300
commit56958cd2e7d3942d0e8e5c6bcff5a0ca97c5ddf2 (patch)
tree353bf14826b2bdd7996bb6aba071fac550c844c6
parentb84159e4410ce640908d640dfe8be17ccd61a5dd (diff)
Cleanup: Avoid possible NULL pointer error
In normal conditions, `gpf` always has a value, but better move inside the NULL checking.
-rw-r--r--source/blender/editors/gpencil/editaction_gpencil.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/editors/gpencil/editaction_gpencil.c b/source/blender/editors/gpencil/editaction_gpencil.c
index 4369d3ce26f..642454508ae 100644
--- a/source/blender/editors/gpencil/editaction_gpencil.c
+++ b/source/blender/editors/gpencil/editaction_gpencil.c
@@ -472,9 +472,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,