diff --git a/MacPass/MPDocument.m b/MacPass/MPDocument.m index 574bff14..0034cc01 100644 --- a/MacPass/MPDocument.m +++ b/MacPass/MPDocument.m @@ -173,6 +173,18 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGrou return NO; } +- (NSString *)fileNameExtensionForType:(NSString *)typeName saveOperation:(NSSaveOperationType)saveOperation { + NSString *proposedExtension = [super fileNameExtensionForType:typeName saveOperation:saveOperation]; + if(!self.fileURL) { + return proposedExtension; + } + NSString *actualExtension = self.fileURL.pathExtension; + if(![actualExtension isEqualToString:proposedExtension]) { + NSLog(@"Extension missmatch."); + } + return actualExtension; +} + - (NSData *)dataOfType:(NSString *)typeName error:(NSError * _Nullable __autoreleasing *)outError { if(self.encrypted) { NSLog(@"%@ should not be called on locked databases!", NSStringFromSelector(_cmd));