diff --git a/MainForm.cs b/MainForm.cs index 53a48ee..c57f0b1 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -1464,13 +1464,13 @@ namespace MeshCentralRouter int argFlags = 3; Dictionary jsonAction = new Dictionary(); jsonAction = new JavaScriptSerializer().Deserialize>(data); - if ((jsonAction == null) || (jsonAction["hostname"].GetType() != typeof(string)) || (jsonAction["username"].GetType() != typeof(string)) || (jsonAction["certhash"].GetType() != typeof(string))) return 0; + if ((jsonAction == null) || (jsonAction["hostname"].GetType() != typeof(string)) || (jsonAction["username"].GetType() != typeof(string))) return 0; if (mode == 1) { serverNameComboBox.Text = jsonAction["hostname"].ToString(); userNameTextBox.Text = jsonAction["username"].ToString(); if (jsonAction.ContainsKey("password")) { passwordTextBox.Text = jsonAction["password"].ToString(); argFlags |= 4; } - acceptableCertHash = jsonAction["certhash"].ToString(); + if (jsonAction.ContainsKey("certhash")) { acceptableCertHash = jsonAction["certhash"].ToString(); } } if (jsonAction["mappings"] != null) {