Fix #134155: Crash when searching in properties editor.
Mistake in recent RNA refactor (45f231141d), not sure why I ended up
returning empty PointerRNA with non-null type when calling
`RNA_id_create_pointer` with a null ID...
In general, PointerRNA with no data ==> no type either, we are trying to
get rid of the very few exceptions in our codebase relying on a
different behavior!
This commit is contained in:
@@ -173,14 +173,13 @@ PointerRNA RNA_main_pointer_create(Main *main)
|
||||
|
||||
PointerRNA RNA_id_pointer_create(ID *id)
|
||||
{
|
||||
PointerRNA ptr{id, &RNA_ID, id};
|
||||
|
||||
if (id) {
|
||||
ptr.type = ID_code_to_RNA_type(GS(id->name));
|
||||
PointerRNA ptr{id, ID_code_to_RNA_type(GS(id->name)), id};
|
||||
rna_pointer_refine(ptr);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
return ptr;
|
||||
return PointerRNA_NULL;
|
||||
}
|
||||
|
||||
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
|
||||
|
||||
Reference in New Issue
Block a user