diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2022-01-18 15:44:27 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2022-01-20 23:12:36 +0300 |
commit | 822501d86df99fd83ee4f2a745daeb7ef4556f22 (patch) | |
tree | a748429ecd9a214572c2585bc3a75d92bd3c55db | |
parent | b3fe135854776079353169fc1bbec2eeb8acef00 (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.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 58f3eba39a4..15903f2fceb 100644 --- a/source/blender/editors/gpencil/editaction_gpencil.c +++ b/source/blender/editors/gpencil/editaction_gpencil.c @@ -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, |