From e15591a1d79b439fe539e627bb7331da093214cc Mon Sep 17 00:00:00 2001
From: Bastien Montagne <montagne29@wanadoo.fr>
Date: Fri, 16 Mar 2018 15:15:29 +0100
Subject: [PATCH] Fix (unreported) a broken 'RNA diff collection' case.

When a name property is defined for collection's struct, but no name is
actually set, we want to also fallback to index case. We cannot handle
empty names to address items of a collection!
---
 source/blender/makesrna/intern/rna_rna.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c
index 8cf9bc7d39c..9c043c3563a 100644
--- a/source/blender/makesrna/intern/rna_rna.c
+++ b/source/blender/makesrna/intern/rna_rna.c
@@ -1458,6 +1458,10 @@ int rna_property_override_diff_default(PointerRNA *ptr_a, PointerRNA *ptr_b,
 				if (propname != NULL) {
 					propname_a = RNA_property_string_get_alloc(&iter_a.ptr, propname, propname_buff_a, sizeof(propname_buff_a), NULL);
 					propname_b = RNA_property_string_get_alloc(&iter_b.ptr, propname, propname_buff_b, sizeof(propname_buff_b), NULL);
+				}
+				/* There may be a propname defined in some cases, while no actual name set
+				 * (e.g. happens with point cache), in that case too we want to fall back to index. */
+				if ((propname_a != NULL && propname_a[0] != '\0') || (propname_b != NULL && propname_b[0] != '\0')) {
 					if (!STREQ(propname_a, propname_b)) {
 						/* Same as above, not same structs. */
 						equals = false;
-- 
GitLab