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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

patrick-tresp
Copy link

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
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
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.

None yet

2 participants