Commit: 1a00c6ae3693f89a57d32014a2fe8d8f994630c1
Author: Antonio Vazquez
Date:   Thu Aug 10 17:40:38 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rB1a00c6ae3693f89a57d32014a2fe8d8f994630c1

Fix errors after merge

===================================================================

M       source/blender/blenkernel/intern/gpencil.c

===================================================================

diff --git a/source/blender/blenkernel/intern/gpencil.c 
b/source/blender/blenkernel/intern/gpencil.c
index 0b8210cd3ea..efae314235c 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -966,14 +966,20 @@ void BKE_gpencil_copy_data(Main *UNUSED(bmain), bGPdata 
*gpd_dst, const bGPdata
 /* make a copy of a given gpencil datablock */
 bGPdata *BKE_gpencil_data_duplicate(Main *bmain, const bGPdata *gpd_src, bool 
internal_copy)
 {
+       const bGPDlayer *gpl_src;
+       bGPDlayer *gpl_dst;
+       bGPdata *gpd_dst;
+
        /* Yuck and super-uber-hyper yuck!!!
         * Should be replaceable with a no-main copy (LIB_ID_COPY_NO_MAIN 
etc.), but not sure about it,
         * so for now keep old code for that one. */
-       if (internal_copy) {
-               const bGPDlayer *gpl_src;
-               bGPDlayer *gpl_dst;
-               bGPdata *gpd_dst;
+        
+       /* error checking */
+       if (gpd_src == NULL) {
+               return NULL;
+       }
 
+       if (internal_copy) {
                /* make a straight copy for undo buffers used during stroke 
drawing */
                gpd_dst = MEM_dupallocN(gpd_src);
        }

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to