From 9baacf6ed767b655fc790116a311f1878fa24bbe Mon Sep 17 00:00:00 2001 From: Kevin Jump Date: Mon, 9 Dec 2019 16:25:34 +0000 Subject: [PATCH] if json parsing fails, we still track the change. --- uSync8.Core/Tracking/SyncBaseTracker.cs | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/uSync8.Core/Tracking/SyncBaseTracker.cs b/uSync8.Core/Tracking/SyncBaseTracker.cs index d3e8a4ef..59c288be 100644 --- a/uSync8.Core/Tracking/SyncBaseTracker.cs +++ b/uSync8.Core/Tracking/SyncBaseTracker.cs @@ -395,20 +395,23 @@ protected uSyncChange Compare(string path, string name, string current, string t { if (current.DetectIsJson()) { - return JsonChange(current, target, path, name); + return JsonChange(path, name, current, target, maskValue); } else { - if (current.Equals(target)) return null; - - return uSyncChange.Update(path, name, - maskValue ? "*******" : current, - maskValue ? "*******" : target); + return StringChange(path, name, current, target, maskValue); } + } + private uSyncChange StringChange(string path, string name, string current, string target, bool maskValue) + { + if (current.Equals(target)) return null; + return uSyncChange.Update(path, name, + maskValue ? "*******" : current, + maskValue ? "*******" : target); } - private uSyncChange JsonChange(string current, string target, string path, string name) + private uSyncChange JsonChange(string path, string name, string current, string target, bool maskValue) { try { @@ -422,8 +425,7 @@ private uSyncChange JsonChange(string current, string target, string path, strin } catch { - // malformed json etc, shouldn't make a details check fail. - return null; + return StringChange(path, name, current, target, maskValue); } }