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

Read file fails when calling get of a non existing id #23

Open
aglpy opened this issue Jan 31, 2023 · 0 comments
Open

Read file fails when calling get of a non existing id #23

aglpy opened this issue Jan 31, 2023 · 0 comments

Comments

@aglpy
Copy link

aglpy commented Jan 31, 2023

I tried to read a doc id that doesn't exists, because there is no a .exists property I supposed that the .get() will return null if not exists. But it doesn't happen, with this code:

import 'package:localstore/localstore.dart' as loc_s;

class DatabaseService {

  static loc_s.Localstore localInstance = loc_s.Localstore.instance;
  final loc_s.CollectionRef moviesDataLocal = localInstance.collection('movies');

  Future getMovieInfo() async {
    Map<String, dynamic>? localInfo = await moviesDataLocal.doc('a').get();
    return localInfo;
  }

}

And neither the collection 'movies' nor doc 'a' exists, instead of null I got an exception on file '...AppData\Local\Pub\Cache\hosted\pub.dev\localstore-1.3.4\lib\src\utils\io.dart'

This one:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant