summaryrefslogtreecommitdiff
path: root/src/wx/screen_dialog.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-12-22 20:26:24 +0100
committerCarl Hetherington <cth@carlh.net>2020-12-22 20:26:24 +0100
commite026ba2c11f16fe2d486acdd489050538e66fece (patch)
treedfdbc8b7ddac9f3a4287dfab20c387b7c1154be5 /src/wx/screen_dialog.cc
parenta298c25e5b9a4d154a46ee21b76f419168358f01 (diff)
Fix error when cancelling load of a trusted device certificate.
Diffstat (limited to 'src/wx/screen_dialog.cc')
-rw-r--r--src/wx/screen_dialog.cc13
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())));
+ }
}
}