Spotify4Unity
Spotify4Unity copied to clipboard
NULL Reference Exception in ExampleDevicesController.cs
Hi,
I have configured the app according to the instructions. When I hit play and click the "Connect" button in the "MobileScene" I get the following logs:
-
Spotify4Unity - Recieved Inplicit authorization on Mobile, Expires at '1/1/0001 12:00:00 AM' UnityEngine.Debug:Log(Object)
-
Spotify4Unity - Successfully connected to the Spotify Web API
-
Spotify4Unity - Saved auth token to reuse
-
NullReferenceException: Object reference not set to an instance of an object ExampleDevicesController.OnDevicesChanged (Spotify4Unity.Events.DevicesChanged e) (at Assets/Spotify4Unity/examples/all_controls/scripts/ExampleDevicesController.cs:69) EventManager+<>c__DisplayClass11_0`1[T].<AddDelegate>b__0 (Spotify4Unity.Events.GameEventBase e) (at Assets/Spotify4Unity/api/event_manager/EventManager.cs:63) EventManager.TriggerEvent (Spotify4Unity.Events.GameEventBase e) (at Assets/Spotify4Unity/api/event_manager/EventManager.cs:135) EventManager.Update () (at Assets/Spotify4Unity/api/event_manager/EventManager.cs:188)
The null reference is pointing towards the SpotifyService here: Device activeDevice = m_devices.FirstOrDefault(x => x.Id == SpotifyService.ActiveDevice.Id);
SpotifyService.ActiveDevice is NULL.
I think I am missing something small.