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

catch NPEs when calling replaceTrack #780

Merged
merged 4 commits into from
Aug 14, 2024

Conversation

patrick-tresp
Copy link
Contributor

I have addressed the issue of Null Pointer Exceptions in the iosrtcPlugin#RTCPeerConnection_RTCRtpSender_replaceTrack() method. I am using this plugin in a capacitor project where it can lead to app crashes without checking for nil values before accessing their properties.

Early Existence Checks: I have introduced early existence checks to ensure that critical objects, such as pluginRTCPeerConnection and pluginRTCRptSender, are not nil before attempting to use them.

Graceful Handling of Missing Objects: In case any of these objects are not found, I now emit error messages with informative details to assist with debugging and troubleshooting.

Safety for Optional Values: I have utilized Swift's optional binding (if let) to safely unwrap and use optional values like pluginMediaStreamTrack.

@hthetiot
Copy link
Contributor

hthetiot commented Nov 3, 2023

Hello @patrick-tresp thank you for your PR, can you revert the version increment, it is made during release only. Then I will test and release.

@hthetiot
Copy link
Contributor

hthetiot commented Nov 3, 2023

Notice that next release will also include this fix for nil sender #770

@patrick-tresp
Copy link
Contributor Author

Hello @patrick-tresp thank you for your PR, can you revert the version increment, it is made during release only. Then I will test and release.

nice, thank you ,reverted already.

@hthetiot
Copy link
Contributor

hthetiot commented Nov 4, 2023

Thx will for review fix.
I will merge and attempt to release next week after testing.

package.json Outdated Show resolved Hide resolved
@hthetiot
Copy link
Contributor

hthetiot commented Jan 5, 2024

Thank you @patrick-tresp , that why i dont close PR or Issues even after a while, you never know.
I love the last commit 96be63b super clean.
Let me know if you tested, an i will merge on master, then release ASAP.

@hthetiot hthetiot added this to the 8.0.x milestone Jan 5, 2024
@hthetiot hthetiot merged commit a8a1c78 into cordova-rtc:master Aug 14, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants