mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-29 02:07:39 +08:00
Note.load: lastModified can throw an exception
Fixes APP-V
This commit is contained in:
@ -165,9 +165,17 @@ class Note with NotesNotifier {
|
||||
|
||||
final file = File(_filePath);
|
||||
if (_loadState == NoteLoadState.Loaded) {
|
||||
var fileLastModified = file.lastModifiedSync();
|
||||
if (this.fileLastModified == fileLastModified) {
|
||||
return _loadState;
|
||||
try {
|
||||
var fileLastModified = file.lastModifiedSync();
|
||||
if (this.fileLastModified == fileLastModified) {
|
||||
return _loadState;
|
||||
}
|
||||
} on FileSystemException catch (e) {
|
||||
if (e.osError.errorCode == 2 /* File Not Found */) {
|
||||
_loadState = NoteLoadState.NotExists;
|
||||
_notifyModified();
|
||||
return _loadState;
|
||||
}
|
||||
}
|
||||
Log.d("Note modified: $_filePath");
|
||||
}
|
||||
|
Reference in New Issue
Block a user