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

deleteItem exception #55

Closed
doc-rj-celltrak opened this issue Dec 17, 2020 · 5 comments
Closed

deleteItem exception #55

doc-rj-celltrak opened this issue Dec 17, 2020 · 5 comments

Comments

@doc-rj-celltrak
Copy link

In 3.0.4+7, calling deleteItem() crashes in flush() if there is no file (nothing has been written yet).

flutter: NoSuchMethodError: The method 'lock' was called on null.
Receiver: null
Tried calling: lock()
flutter:
#0 Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5)
#1 DirUtils.flush (package:localstorage/src/directory/io.dart:46:25)
#2 LocalStorage._flush (package:localstorage/localstorage.dart:103:18)
#3 LocalStorage.deleteItem (package:localstorage/localstorage.dart:92:12)

@doc-rj-celltrak
Copy link
Author

doc-rj-celltrak commented Dec 17, 2020

Hmmmm, we're seeing the issue with setItem() too, even though we are awaiting ready during initialization.

flutter: NoSuchMethodError: The method 'lock' was called on null.
Receiver: null
Tried calling: lock()
flutter:
#0 Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5)
#1 DirUtils.flush (package:localstorage/src/directory/io.dart:46:25)
#2 LocalStorage._flush (package:localstorage/localstorage.dart:103:18)
#3 LocalStorage.setItem (package:localstorage/localstorage.dart:86:12)

===

final storage = LocalStorage('redux.json', cttPath);
await storage.ready;
...

@PerLycke
Copy link

Same issue here after updating from 3.0.3+6 to 3.0.4+7

@Stevensie95
Copy link

Try to change version from ^3.0.4+7 to ^3.0.4

@lesnitsky
Copy link
Owner

please check v3.0.5

@lesnitsky
Copy link
Owner

sorry for the inconvenience

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

4 participants