{"action":"created","issue":{"url":"https://api.github.com/repos/ConnectSDK/Connect-SDK-Android/issues/215","labels_url":"https://api.github.com/repos/ConnectSDK/Connect-SDK-Android/issues/215/labels{/name}","comments_url":"https://api.github.com/repos/ConnectSDK/Connect-SDK-Android/issues/215/comments","events_url":"https://api.github.com/repos/ConnectSDK/Connect-SDK-Android/issues/215/events","html_url":"https://github.com/ConnectSDK/Connect-SDK-Android/issues/215","id":57738796,"number":215,"title":"java.lang.NullPointerException: Attempt to invoke virtual method 'int com.google.android.gms.cast.MediaStatus.getPlayerState()' on a null object reference","user":{"login":"mntgoat","id":1638377,"avatar_url":"https://avatars.githubusercontent.com/u/1638377?v=3","gravatar_id":"","url":"https://api.github.com/users/mntgoat","html_url":"https://github.com/mntgoat","followers_url":"https://api.github.com/users/mntgoat/followers","following_url":"https://api.github.com/users/mntgoat/following{/other_user}","gists_url":"https://api.github.com/users/mntgoat/gists{/gist_id}","starred_url":"https://api.github.com/users/mntgoat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mntgoat/subscriptions","organizations_url":"https://api.github.com/users/mntgoat/orgs","repos_url":"https://api.github.com/users/mntgoat/repos","events_url":"https://api.github.com/users/mntgoat/events{/privacy}","received_events_url":"https://api.github.com/users/mntgoat/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ConnectSDK/Connect-SDK-Android/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"khk624","id":5640432,"avatar_url":"https://avatars.githubusercontent.com/u/5640432?v=3","gravatar_id":"","url":"https://api.github.com/users/khk624","html_url":"https://github.com/khk624","followers_url":"https://api.github.com/users/khk624/followers","following_url":"https://api.github.com/users/khk624/following{/other_user}","gists_url":"https://api.github.com/users/khk624/gists{/gist_id}","starred_url":"https://api.github.com/users/khk624/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khk624/subscriptions","organizations_url":"https://api.github.com/users/khk624/orgs","repos_url":"https://api.github.com/users/khk624/repos","events_url":"https://api.github.com/users/khk624/events{/privacy}","received_events_url":"https://api.github.com/users/khk624/received_events","type":"User","site_admin":false},"milestone":null,"comments":31,"created_at":"2015-02-15T17:52:39Z","updated_at":"2015-03-23T15:27:14Z","closed_at":null,"body":"I got an exception after connecting to a Chromecast (has only happened once). Basically as soon as I connect I request the player state to see if I was already playing a video. Here is the stacktrace, most of it is my code but the exception happens on  com.connectsdk.service.CastService.getPlayState(CastService.java:1061). I can easily trap it but I figured I should report it. I am using connectSDK 1.4.\r\n\r\njava.lang.NullPointerException: Attempt to invoke virtual method 'int com.google.android.gms.cast.MediaStatus.getPlayerState()' on a null object reference\r\n            at com.connectsdk.service.CastService.getPlayState(CastService.java:1061)\r\n            at mypackage.control.MediaHelper.requestPlaybackState(MediaHelper.java:696)\r\n            at mypackage.control.MediaHelper.startPlayingActivityIfPlaying(MediaHelper.java:560)\r\n            at mypackage.ui.SomeActivity$MyMediaEventConsumer.deviceReady(SomeActivity.java:183)\r\n            at mypackage.control.MediaHelper$MediaHelperDeviceListener.onDeviceReady(MediaHelper.java:919)\r\n            at com.connectsdk.device.ConnectableDevice$4.run(ConnectableDevice.java:975)\r\n            at android.os.Handler.handleCallback(Handler.java:739)\r\n            at android.os.Handler.dispatchMessage(Handler.java:95)\r\n            at android.os.Looper.loop(Looper.java:135)\r\n            at android.app.ActivityThread.main(ActivityThread.java:5221)\r\n            at java.lang.reflect.Method.invoke(Native Method)\r\n            at java.lang.reflect.Method.invoke(Method.java:372)\r\n            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)\r\n            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)\r\n            "},"comment":{"url":"https://api.github.com/repos/ConnectSDK/Connect-SDK-Android/issues/comments/85049495","html_url":"https://github.com/ConnectSDK/Connect-SDK-Android/issues/215#issuecomment-85049495","issue_url":"https://api.github.com/repos/ConnectSDK/Connect-SDK-Android/issues/215","id":85049495,"user":{"login":"mntgoat","id":1638377,"avatar_url":"https://avatars.githubusercontent.com/u/1638377?v=3","gravatar_id":"","url":"https://api.github.com/users/mntgoat","html_url":"https://github.com/mntgoat","followers_url":"https://api.github.com/users/mntgoat/followers","following_url":"https://api.github.com/users/mntgoat/following{/other_user}","gists_url":"https://api.github.com/users/mntgoat/gists{/gist_id}","starred_url":"https://api.github.com/users/mntgoat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mntgoat/subscriptions","organizations_url":"https://api.github.com/users/mntgoat/orgs","repos_url":"https://api.github.com/users/mntgoat/repos","events_url":"https://api.github.com/users/mntgoat/events{/privacy}","received_events_url":"https://api.github.com/users/mntgoat/received_events","type":"User","site_admin":false},"created_at":"2015-03-23T15:27:14Z","updated_at":"2015-03-23T15:27:14Z","body":"This appears to work well for the case of joining an existing playing application. \r\n\r\nI now only need to be able to start my webapp on connect if it wasn't already running but without disrupting it if it already was. I can always implement that myself on my end as long as I can do it on the onDeviceReady event.\r\n\r\nlaunchWebApp with false for relaunchIfRunning does appear to work weird. Could it be because that has been deprecated on the cast api? they recommend you use this instead https://developer.android.com/reference/com/google/android/gms/cast/Cast.CastApi.html#launchApplication(com.google.android.gms.common.api.GoogleApiClient, java.lang.String, com.google.android.gms.cast.LaunchOptions)\r\n\r\n"}}