Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

App crash on iOS with sendEvent and segments #43

Closed
andreialecu opened this issue Feb 7, 2019 · 3 comments
Closed

App crash on iOS with sendEvent and segments #43

andreialecu opened this issue Feb 7, 2019 · 3 comments
Assignees

Comments

@andreialecu
Copy link
Contributor

andreialecu commented Feb 7, 2019

I'm just implementing this plugin and saw my iOS app hard-crash while calling Countly.sendEvent

Upon inspection, I think it is because I didn't have eventCount properly defined on the parameter to sendEvent. After setting eventCount to 1 it stopped crashing.

Relevant lines:
https://github.com/Countly/countly-sdk-js/blob/master/Countly.js#L52
https://github.com/Countly/countly-sdk-js/blob/master/src/ios/CountlyCordova.m#L276

Since eventCount is not defined, the whole array is shifted so the iOS routine crashes by assuming an index in the array that doesn't exist.

I think it's safe to just assume eventCount to be 1 in Countly.js there if it is not defined.

@gorkem-cetin
Copy link
Contributor

Many thanks @andreialecu - let's check this :-)

@trinisofttechnologies
Copy link
Contributor

Yes, I have defaulted it to 1, but I will check it.

@trinisofttechnologies
Copy link
Contributor

Yes, defaulted the count to 1, it was missing.

I will have a test example for it, where multiple data type missing, and confirming the sdk doesn't crash.

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

No branches or pull requests

3 participants