diff --git a/MacPass/MPDocumentWindowController.m b/MacPass/MPDocumentWindowController.m index 072fd208..a527e3d1 100644 --- a/MacPass/MPDocumentWindowController.m +++ b/MacPass/MPDocumentWindowController.m @@ -342,7 +342,10 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword); } - (IBAction)lock:(id)sender { - MPDocument *document = [self document]; + MPDocument *document = self.document; + if(document.encrypted) { + return; // Document already locked + } if(!document.compositeKey) { [self editPasswordWithCompetionHandler:^(NSInteger result) { if(result == NSModalResponseOK) { @@ -351,9 +354,6 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword); }]; return; } - if(document.encrypted) { - return; // Document already locked - } [document lockDatabase:sender]; }