mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
tools: Add null check for struct ptrs in CToCpp wrapper (see #3836)
This commit is contained in:
@ -102,6 +102,10 @@ def make_ctocpp_function_impl_new(cls, name, func, base_scoped, version,
|
|||||||
result += '\n auto* _struct = reinterpret_cast<'+\
|
result += '\n auto* _struct = reinterpret_cast<'+\
|
||||||
func.parent.get_capi_name(version=version)+'*>(GetStruct());'
|
func.parent.get_capi_name(version=version)+'*>(GetStruct());'
|
||||||
|
|
||||||
|
result += '\n if (!_struct->' + func.get_capi_name() + ') {'\
|
||||||
|
'\n return' + retval_default + ';'\
|
||||||
|
'\n }\n'
|
||||||
|
|
||||||
# add API hash check
|
# add API hash check
|
||||||
if func.has_attrib('api_hash_check'):
|
if func.has_attrib('api_hash_check'):
|
||||||
result += '\n const char* api_hash = cef_api_hash(CEF_API_VERSION, 0);'\
|
result += '\n const char* api_hash = cef_api_hash(CEF_API_VERSION, 0);'\
|
||||||
|
Reference in New Issue
Block a user