fix warnings: enumeration values 'XX' not handled in switch [-Wswitch-enum]
[novacoin.git] / src / qt / editaddressdialog.cpp
index 457e8cf..cecb8ae 100644 (file)
@@ -56,6 +56,8 @@ void EditAddressDialog::loadRow(int row)
 
 bool EditAddressDialog::saveCurrentRow()
 {
+    if(!model)
+        return false;
     switch(mode)
     {
     case NewReceivingAddress:
@@ -78,6 +80,8 @@ bool EditAddressDialog::saveCurrentRow()
 
 void EditAddressDialog::accept()
 {
+    if(!model)
+        return;
     if(!saveCurrentRow())
     {
         switch(model->getEditStatus())
@@ -102,6 +106,9 @@ void EditAddressDialog::accept()
                 tr("New key generation failed."),
                 QMessageBox::Ok, QMessageBox::Ok);
             return;
+        case AddressTableModel::OK:
+            // Failed with unknown reason. Just reject.
+            break;
         }
 
         return;