isar / isar/hive

Null operator used on a null value

Open
#745 0 comments 0 reactions 0 assignees View on GitHub
problem
Dominant language
Dart
Stars
4.4k
Forks
449
PR merge metrics
No merged PRs in 30d

Description

I want to attach an image of the stacktrace. I don't know if its a Hive error or my bad, but looking at my code, it doesn't seem to have any problem:
![image](https://user-images.githubusercontent.com/31850785/127583186-ba769c72-c11f-4ad0-9f8b-8b8d516e81a0.png)

My code:
```dart
if(_box.lazy) {

// Convert to lazy box
LazyBox lazyBox = _box as LazyBox;

// Partition a set of keys into batches of 100
// int currentPage = page?.offsetPagination.
Iterable> keys = partition(lazyBox.keys.take(500).cast(), 100);

// Wait for all futures
try {
var results = await Future.wait(keys.expand((element) => element).map((key) => lazyBox.get(key).catchError((err) {
debugPrint("Error getting key $key");
return null;
})));

values = results.where((element) => element != null).cast();
} catch(err) {
debugPrint(err.toString());
}

values = [];
} else {
values = (_box as Box).values;
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.