diff --git a/source/blender/makesrna/intern/rna_path.cc b/source/blender/makesrna/intern/rna_path.cc index 79ca194e08e..7a59928b1d1 100644 --- a/source/blender/makesrna/intern/rna_path.cc +++ b/source/blender/makesrna/intern/rna_path.cc @@ -125,9 +125,12 @@ static char *rna_path_token_in_brackets(const char **path, return nullptr; } - /* Empty, return. */ - if (UNLIKELY(len == 0)) { - return nullptr; + /* Support empty strings in quotes, as this is a valid key for an ID-property. */ + if (!quoted) { + /* Empty, return. */ + if (UNLIKELY(len == 0)) { + return nullptr; + } } /* Try to use fixed buffer if possible. */ diff --git a/tests/python/bl_pyapi_idprop.py b/tests/python/bl_pyapi_idprop.py index bf4db9621c3..d6d78f248ba 100644 --- a/tests/python/bl_pyapi_idprop.py +++ b/tests/python/bl_pyapi_idprop.py @@ -281,6 +281,8 @@ class TestRNAData(TestHelper, unittest.TestCase): '[""]', '["""]', '[""""]', + # Empty properties are also valid. + "", ) for key_id in keys_to_test: self.id[key_id] = 1