diff --git a/MeshCentralServer.cs b/MeshCentralServer.cs index 169a69d..b983202 100644 --- a/MeshCentralServer.cs +++ b/MeshCentralServer.cs @@ -194,7 +194,18 @@ namespace MeshCentralRouter // Parse the received JSON Dictionary jsonAction = new Dictionary(); - jsonAction = new JavaScriptSerializer().Deserialize>(data); + try + { + jsonAction = new JavaScriptSerializer().Deserialize>(data); + } catch (Exception ex) { + if (debug) { + try { + File.AppendAllText("debug.log", "processServerData JSON Deserialize error: \r\n" + ex.ToString()); + File.AppendAllText("debug.log", "Invalid data (" + data.Length + "): \r\n" + data); + } catch (Exception) { } + } + return; + } if (jsonAction == null || jsonAction["action"].GetType() != typeof(string)) return; string action = jsonAction["action"].ToString();