Skip to content

Commit fcaf2a2

Browse files
Fix _testGet in Flutter demo
1 parent 13281f5 commit fcaf2a2

File tree

1 file changed

+1
-1
lines changed
  • examples/flutter/objectbox_demo_desktop/lib

1 file changed

+1
-1
lines changed

examples/flutter/objectbox_demo_desktop/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class _MyHomePageState extends State<MyHomePage> {
5151
int _lastPutId;
5252

5353
void _testGet() {
54-
final Note fetchedNote = _box.get(_lastPutId);
54+
final Note fetchedNote = _lastPutId == null ? null : _box.get(_lastPutId);
5555
setState(() {
5656
if(_lastPutId == null) {
5757
_status += "cannot get, as nothing was put in this session yet\n";

0 commit comments

Comments
 (0)