Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle undefined callbacks in setters on iOS native module #1015

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

onurersel
Copy link

Sequence of events that ends up with crash are:

  1. Set one of the callback with a function (ie. onError)
  2. Try to load an invalid image, that will result with onError callback being called.
  3. Set onError callback to undefined.

At this point, native iOS module tries to call the undefined function, which crashes the app with EXT_BAD_ACCESS.

This PR updates all setter functions and checks if the callback function exists before calling them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant