diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-12-22 20:26:24 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-12-22 20:26:24 +0100 |
| commit | e026ba2c11f16fe2d486acdd489050538e66fece (patch) | |
| tree | dfdbc8b7ddac9f3a4287dfab20c387b7c1154be5 /src | |
| parent | a298c25e5b9a4d154a46ee21b76f419168358f01 (diff) | |
Fix error when cancelling load of a trusted device certificate.
Diffstat (limited to 'src')
| -rw-r--r-- | src/wx/screen_dialog.cc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/wx/screen_dialog.cc b/src/wx/screen_dialog.cc index 7f309ba66..030098920 100644 --- a/src/wx/screen_dialog.cc +++ b/src/wx/screen_dialog.cc @@ -69,12 +69,13 @@ public: void load_certificate () { wxFileDialog* d = new wxFileDialog (this, _("Trusted Device certificate")); - d->ShowModal (); - try { - _certificate = dcp::Certificate(dcp::file_to_string(wx_to_std(d->GetPath()))); - _thumbprint->SetValue (std_to_wx(_certificate->thumbprint())); - } catch (dcp::MiscError& e) { - error_dialog (this, wxString::Format(_("Could not load certficate (%s)"), std_to_wx(e.what()))); + if (d->ShowModal() == wxID_OK) { + try { + _certificate = dcp::Certificate(dcp::file_to_string(wx_to_std(d->GetPath()))); + _thumbprint->SetValue (std_to_wx(_certificate->thumbprint())); + } catch (dcp::MiscError& e) { + error_dialog (this, wxString::Format(_("Could not load certficate (%s)"), std_to_wx(e.what()))); + } } } |
