Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

subscribeConnectionStatus on Android crashes due to null-safety issue #91

Closed
ndahlquist opened this issue Apr 7, 2021 · 4 comments
Closed
Assignees
Labels
android Specific for android bug Something isn't working

Comments

@ndahlquist
Copy link
Contributor

Describe the bug

After upgrading from 1.0.2 to 2.0.0, I am seeing the following crash:

E/flutter (19977): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: type 'Null' is not a subtype of type 'String' in type cast
E/flutter (19977): #0      _$ConnectionStatusFromJson (package:spotify_sdk/models/connection_status.g.dart:12:23)
E/flutter (19977): #1      new ConnectionStatus.fromJson (package:spotify_sdk/models/connection_status.dart:29:7)
E/flutter (19977): #2      SpotifySdk.subscribeConnectionStatus.<anonymous closure> (package:spotify_sdk/spotify_sdk.dart:314:33)
E/flutter (19977): #3      Stream.asyncMap.<anonymous closure>.<anonymous closure> (dart:async/stream.dart:554:29)
E/flutter (19977): #4      _rootRunUnary (dart:async/zone.dart:1362:47)
E/flutter (19977): #5      _CustomZone.runUnary (dart:async/zone.dart:1265:19)
E/flutter (19977): #6      _CustomZone.runUnaryGuarded (dart:async/zone.dart:1170:7)
E/flutter (19977): #7      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)
E/flutter (19977): #8      _DelayedData.perform (dart:async/stream_impl.dart:591:14)
E/flutter (19977): #9      _StreamImplEvents.handleNext (dart:async/stream_impl.dart:706:11)
E/flutter (19977): #10     _PendingEvents.schedule.<anonymous closure> (dart:async/stream_impl.dart:663:7)
E/flutter (19977): #11     _rootRun (dart:async/zone.dart:1346:47)
E/flutter (19977): #12     _CustomZone.run (dart:async/zone.dart:1258:19)
E/flutter (19977): #13     _CustomZone.runGuarded (dart:async/zone.dart:1162:7)
E/flutter (19977): #14     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1202:23)
E/flutter (19977): #15     _rootRun (dart:async/zone.dart:1354:13)
E/flutter (19977): #16     _CustomZone.run (dart:async/zone.dart:1258:19)
E/flutter (19977): #17     _CustomZone.runGuarded (dart:async/zone.dart:1162:7)
E/flutter (19977): #18     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1202:23)
E/flutter (19977): #19     _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
E/flutter (19977): #20     _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)

To Reproduce
Steps to reproduce the behavior:

  1. Call SpotifySdk.subscribeConnectionStatus().listen(callback);
  2. Observe error, and that the callback is not invoked.

Expected behavior
The callback is invoked successfully.

Smartphone (please complete the following information):

  • Device: Pixel 4a
  • OS: Android
  • Version: Android 11
@brim-borium brim-borium self-assigned this Apr 7, 2021
@brim-borium brim-borium added android Specific for android bug Something isn't working labels Apr 7, 2021
@brim-borium
Copy link
Owner

Will have a look at it, probably tomorrow or on the weekend

@ndahlquist
Copy link
Contributor Author

Tried my hand at a fix, hope that helps!

@fotiDim
Copy link
Collaborator

fotiDim commented Apr 8, 2021

Thanks for the PR. Let's close this after the next release.

@brim-borium
Copy link
Owner

The new release 2.1.0 is out and should fix the issue. Closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android Specific for android bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants