fix for memory leak, use Key Errors for pyrna getitem access & idprops
[blender.git] / source / blender / makesrna / intern / rna_access.c
index 355b61a0c49bea1dacd9e42674895aa61e97d556..3e30827fad221d41f57fbf1250f72efa92cadd8d 100644 (file)
@@ -2344,13 +2344,8 @@ int RNA_path_resolve(PointerRNA *ptr, const char *path, PointerRNA *r_ptr, Prope
 
                if(use_id_prop) { /* look up property name in current struct */
                        IDProperty *group= RNA_struct_idproperties(ptr, 0);
-                       if(!group)
-                               return 0;
-
-                       if(rna_token_strip_quotes(token))
+                       if(group && rna_token_strip_quotes(token))
                                prop= (PropertyRNA *)IDP_GetPropertyFromGroup(group, token+1);
-                       else
-                               prop= NULL;
                }
                else {
                        prop= RNA_struct_find_property(&curptr, token);