bpy fix for crash/assert on running dir() on a non collection property + some other minor corrections.
This commit is contained in:
@@ -3262,11 +3262,15 @@ static PyObject *pyrna_prop_dir(BPy_PropertyRNA *self)
|
||||
* */
|
||||
ret= PyList_New(0);
|
||||
|
||||
if (!BPy_PropertyRNA_CheckExact(self))
|
||||
if (!BPy_PropertyRNA_CheckExact(self)) {
|
||||
pyrna_dir_members_py(ret, (PyObject *)self);
|
||||
}
|
||||
|
||||
if(RNA_property_collection_type_get(&self->ptr, self->prop, &r_ptr))
|
||||
pyrna_dir_members_rna(ret, &r_ptr);
|
||||
if(RNA_property_type(self->prop) == PROP_COLLECTION) {
|
||||
if(RNA_property_collection_type_get(&self->ptr, self->prop, &r_ptr)) {
|
||||
pyrna_dir_members_rna(ret, &r_ptr);
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user