Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.0.0, 2.1.0, 2.2.0, 2.3.0, 2.4.0, 2.5.0, 2.6.0, 2.7.0, 2.8.0, 2.9.0, 3.0.0, 3.1.0, 3.2.0, 3.3.0, 3.4.0, 2.9.1, 3.5.0
-
None
Description
On player creation, we can sometime observe:
E/PluginManager( 5442): Uncaught exception from plugin
E/PluginManager( 5442): java.lang.NullPointerException
E/PluginManager( 5442): at org.apache.cordova.media.AudioPlayer.setVolume(AudioPlayer.java:441)
E/PluginManager( 5442): at org.apache.cordova.media.AudioHandler.setVolume(AudioHandler.java:455)
E/PluginManager( 5442): at org.apache.cordova.media.AudioHandler.execute(AudioHandler.java:143)
E/PluginManager( 5442): at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:98)
E/PluginManager( 5442): at org.apache.cordova.PluginManager.exec(PluginManager.java:133)
E/PluginManager( 5442): at org.apache.cordova.CordovaBridge.jsExec(CordovaBridge.java:59)
E/PluginManager( 5442): at org.apache.cordova.CordovaBridge.promptOnJsPrompt(CordovaBridge.java:135)
E/PluginManager( 5442): at org.apache.cordova.engine.SystemWebChromeClient.onJsPrompt(SystemWebChromeClient.java:124)
E/PluginManager( 5442): at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:886)
E/PluginManager( 5442): at android.os.Handler.dispatchMessage(Handler.java:99)
E/PluginManager( 5442): at android.os.Looper.loop(Looper.java:137)
E/PluginManager( 5442): at android.app.ActivityThread.main(ActivityThread.java:4921)
E/PluginManager( 5442): at java.lang.reflect.Method.invokeNative(Native Method)
E/PluginManager( 5442): at java.lang.reflect.Method.invoke(Method.java:511)
E/PluginManager( 5442): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038)
E/PluginManager( 5442): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
E/PluginManager( 5442): at dalvik.system.NativeStart.main(Native Method)
GitHub user fafaman opened a pull request:
https://github.com/apache/cordova-plugin-media/pull/93
Protect setVolume call in case Player object is referenced but not cr…
Hi, this is a fix for https://issues.apache.org/jira/browse/CB-11086. thanks.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/fafaman/cordova-plugin-media
CB-11086cordova-plugin-mediaAlternatively you can review and apply these changes as the patch at:
https://github.com/apache/cordova-plugin-media/pull/93.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #93
commit 930fe187e0a2385ce9f693f8fc92b465c04e13ac
Author: Fabrice Lebas <fabrice.lebas@gmail.com>
Date: 2016-04-14T15:14:00Z
Protect setVolume call in case Player object is referenced but not created yet