Note sorting: 'created' can now be null

Earlier it was always something
This commit is contained in:
Vishesh Handa
2020-01-01 19:50:52 +01:00
parent 36d1ae43c3
commit 2821eb1f8b

View File

@ -178,10 +178,7 @@ class Note with ChangeNotifier implements Comparable<Note> {
var dt = modified ?? created;
var otherDt = other.modified ?? other.created;
if (dt == null && otherDt == null) {
return filePath.compareTo(other.filePath);
}
if (dt.year == 0 || otherDt.year == 0) {
if (dt == null || otherDt == null) {
return filePath.compareTo(other.filePath);
}