warn when getting a context member fails because of type mismatch
This commit is contained in:
@@ -370,8 +370,15 @@ PointerRNA CTX_data_pointer_get_type(const bContext *C, const char *member, Stru
|
||||
{
|
||||
PointerRNA ptr = CTX_data_pointer_get(C, member);
|
||||
|
||||
if (ptr.data && RNA_struct_is_a(ptr.type, type))
|
||||
return ptr;
|
||||
if (ptr.data) {
|
||||
if (RNA_struct_is_a(ptr.type, type)) {
|
||||
return ptr;
|
||||
}
|
||||
else {
|
||||
printf("%s: warning, member '%s' is '%s', not '%s'\n",
|
||||
__func__, member, RNA_struct_identifier(ptr.type), RNA_struct_identifier(type));
|
||||
}
|
||||
}
|
||||
|
||||
return PointerRNA_NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user