Fix RNA collection accessor (string search) not checking for null key pointer.
While in a way one could argue calling code could check for such case, in practice it is way handier for the search code itself to just return 'not found' value in such case, rather than crash!
This commit is contained in:
parent
47672bd06a
commit
66c05fe368
|
@ -4310,6 +4310,12 @@ int RNA_property_collection_lookup_string_index(
|
|||
|
||||
BLI_assert(RNA_property_type(prop) == PROP_COLLECTION);
|
||||
|
||||
if (!key) {
|
||||
*r_index = -1;
|
||||
*r_ptr = PointerRNA_NULL;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (cprop->lookupstring) {
|
||||
/* we have a callback defined, use it */
|
||||
return cprop->lookupstring(ptr, key, r_ptr);
|
||||
|
|
Loading…
Reference in New Issue