Check for mismatched passwords BEFORE saving to prevent data loss

This commit is contained in:
Jonathan White 2017-09-29 12:24:14 -04:00 committed by Jonathan White
parent 59786d7bd7
commit de5f8082de

View File

@ -446,6 +446,12 @@ void EditEntryWidget::saveEntry()
void EditEntryWidget::acceptEntry() void EditEntryWidget::acceptEntry()
{ {
// Check if passwords are mismatched first to prevent saving
if (!passwordsEqual()) {
showMessage(tr("Different passwords supplied."), MessageWidget::Error);
return;
}
saveEntry(); saveEntry();
clear(); clear();
emit editFinished(true); emit editFinished(true);