Fix segfault when not saving new document

This commit is contained in:
Ariel Abreu 2021-01-25 23:17:54 -05:00
parent 98e7f1a359
commit 94994590ac
No known key found for this signature in database
GPG Key ID: BB20848279B910AC

View File

@ -119,9 +119,11 @@ static int untitled_document_number = 0;
- (void) _updateFileModificationDate {
NSFileManager *fileManager = [NSFileManager defaultManager];
NSString *path = [_fileURL path];
NSDictionary *attributes = [fileManager fileAttributesAtPath: path
traverseLink: YES];
[self setFileModificationDate: attributes[NSFileModificationDate]];
if (path != nil) {
NSDictionary *attributes = [fileManager fileAttributesAtPath: path
traverseLink: YES];
[self setFileModificationDate: attributes[NSFileModificationDate]];
}
}
- (instancetype) initWithContentsOfURL: (NSURL *) url