diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2022-01-18 15:44:27 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2022-01-18 15:44:41 +0300 |
commit | 6a8ad00bccdf5cf8e52991e1ca17b12db7b1bab2 (patch) | |
tree | dc09ae7cf4d765e465da8d66d03a395da1649cee /source/blender | |
parent | 08d008a5085bf57ba43c7aa76d51ea60b732a11a (diff) |
Cleanup: Avoid possible NULL pointer error
In normal conditions, `gpf` always has a value, but better move inside the NULL checking.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/gpencil/editaction_gpencil.c | 5 |
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 e1907dd1514..3cc47198cbc 100644 --- a/source/blender/editors/gpencil/editaction_gpencil.c +++ b/source/blender/editors/gpencil/editaction_gpencil.c @@ -454,9 +454,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, |