diff --git a/server/AyaNova/biz/Search.cs b/server/AyaNova/biz/Search.cs index 14d91fd5..1bf9ee61 100644 --- a/server/AyaNova/biz/Search.cs +++ b/server/AyaNova/biz/Search.cs @@ -396,7 +396,10 @@ namespace AyaNova.Biz public SearchIndexProcessObjectParameters AddWord(string s) { - Words.Add(s); + if (!string.IsNullOrWhiteSpace(s)) + { + Words.Add(s); + } return this; } public SearchIndexProcessObjectParameters AddWord(uint u) @@ -406,9 +409,15 @@ namespace AyaNova.Biz } public SearchIndexProcessObjectParameters AddWord(List lWords) { - foreach (string s in lWords) + if (lWords != null) { - Words.Add(s); + foreach (string s in lWords) + { + if (!string.IsNullOrWhiteSpace(s)) + { + Words.Add(s); + } + } } return this; diff --git a/server/AyaNova/biz/TagUtil.cs b/server/AyaNova/biz/TagUtil.cs index 860030ab..d3d846e0 100644 --- a/server/AyaNova/biz/TagUtil.cs +++ b/server/AyaNova/biz/TagUtil.cs @@ -88,7 +88,12 @@ namespace AyaNova.Biz public static void ProcessUpdateTagsInRepository(AyContext ct, List newTags, List originalTags = null) { - if (newTags.Count == 0 && (originalTags == null || originalTags.Count == 0)) return; + //just in case no new tags are present which could mean a user removed all tags from a record so this + //needs to proceed with the code below even if newTags is null as long as originalTags isn't also null + if (newTags == null) newTags = new List(); + if (originalTags == null) originalTags = new List(); + + if (newTags.Count == 0 && originalTags.Count == 0) return; List deleteTags = new List(); List addTags = new List();