Add null check for m_delegate (#318)

* fix formatting

* Add null check for `m_delegate`

---------

Co-authored-by: Mazin Eltahawy <mazintahawy@gmail.com>
Co-authored-by: mat <26722564+matcool@users.noreply.github.com>
This commit is contained in:
Mazin Eltahawy 2023-10-22 16:46:21 +03:00 committed by GitHub
parent 746966c423
commit 2d8e988ce3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -17,7 +17,7 @@ struct CCTextInputNodeFix : Modify<CCTextInputNodeFix, CCTextInputNode> {
if (pos.x < 0 || pos.x > size.width || pos.y < 0 || pos.y > size.height)
return false;
if (!m_delegate->allowTextInput(this))
if (m_delegate && !m_delegate->allowTextInput(this))
return false;
this->onClickTrackNode(true);