You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/08/23 14:34:20 UTC

[jira] [Commented] (CB-11086) setVolume fires a Null pointer exception if called too soon

    [ https://issues.apache.org/jira/browse/CB-11086?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15432907#comment-15432907 ] 

ASF GitHub Bot commented on CB-11086:
-------------------------------------

GitHub user alsorokin opened a pull request:

    https://github.com/apache/cordova-plugin-media/pull/109

    CB-11086 (Android) Fixed a crash when setVolume() is called

    ### Platforms affected
    Android
    
    ### What does this PR do?
    This is a fix for https://issues.apache.org/jira/browse/CB-11086
    It fixes the crash by checking if player is null when trying to set player's volume.
    
    ### What testing has been done on this change?
    Tested on Android emulator 4.4, also checked that added test spec is green on iOS and Windows.
    
    ### Checklist
    - [x] [ICLA](http://www.apache.org/licenses/icla.txt) has been signed and submitted to secretary@apache.org.
    - [x] [Reported an issue](http://cordova.apache.org/contribute/issues.html) in the JIRA database
    - [x] Commit message follows the format: "CB-3232: (android) Fix bug with resolving file paths", where CB-xxxx is the JIRA ID & "android" is the platform affected.
    - [x] Added automated test coverage as appropriate for this change.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/alsorokin/cordova-plugin-media CB-11086

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-plugin-media/pull/109.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 #109
    
----
commit 6c923c9b21a5417dc343aec901935be06e087e63
Author: Alexander Sorokin <al...@akvelon.com>
Date:   2016-08-23T14:18:31Z

    CB-11086 (Android) Fixed a crash when setVolume() is called on unitialized audio

----


> setVolume fires a Null pointer exception if called too soon
> -----------------------------------------------------------
>
>                 Key: CB-11086
>                 URL: https://issues.apache.org/jira/browse/CB-11086
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin Media
>    Affects Versions: 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
>            Reporter: Fabrice Lebas
>            Assignee: Alexander Sorokin
>            Priority: Minor
>              Labels: Android, easyfix, triaged, wfc
>   Original Estimate: 0.5h
>  Remaining Estimate: 0.5h
>
> 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)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org