chaimPaneth / react-native-jw-media-player

React-Native Android/iOS bridge for JWPlayer SDK (https://www.jwplayer.com/)
MIT License
190 stars 91 forks source link

get audio tracks crash bugfix #324

Closed DevineDecrypter closed 7 months ago

DevineDecrypter commented 8 months ago

Hello, I'm using this package in a TVOS application, in older and slower TVs when accessing getAudioTracks function, it crashes the app with the following error (reported on appcenter):

com.appgoalz.rnjwplayer.RNJWPlayerModule$15.execute RNJWPlayerModule.java, line 350

java.lang.NullPointerException: Attempt to invoke interface method 'int java.util.List.size()' on a null object reference

sometimes the audioTrackList is null and it crashes the app. changing the code like this fixed the problem. now instead of crashing it returns an empty Array.

DevineDecrypter commented 8 months ago

Yes after the changes we've had no crashes regarding this issue anymore.