Skip to content

Commit 2821eb1

Browse files
committed
Note sorting: 'created' can now be null
Earlier it was always something
1 parent 36d1ae4 commit 2821eb1

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

lib/core/note.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,7 @@ class Note with ChangeNotifier implements Comparable<Note> {
178178

179179
var dt = modified ?? created;
180180
var otherDt = other.modified ?? other.created;
181-
if (dt == null && otherDt == null) {
182-
return filePath.compareTo(other.filePath);
183-
}
184-
if (dt.year == 0 || otherDt.year == 0) {
181+
if (dt == null || otherDt == null) {
185182
return filePath.compareTo(other.filePath);
186183
}
187184

0 commit comments

Comments
 (0)