chargebee / chargebee-flutter

MIT License
5 stars 8 forks source link

retrieveSubscriptions and retrieveAllItems should not crash if there are no subs/items #27

Closed RobertHeim closed 1 year ago

RobertHeim commented 1 year ago

Currently the implementation uses code like this:

print(subscriptions.first.subscriptionId);

without guaranteeing that subscriptions is not empty. If it is empty, the .first call raises a NPE. Instead of an exception we would expect empty results.