This commit is contained in:
2019-06-06 22:41:40 +00:00
parent 968d38f2a0
commit 9212354ee5
2 changed files with 18 additions and 4 deletions

View File

@@ -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<string> 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;

View File

@@ -88,7 +88,12 @@ namespace AyaNova.Biz
public static void ProcessUpdateTagsInRepository(AyContext ct, List<string> newTags, List<string> 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<string>();
if (originalTags == null) originalTags = new List<string>();
if (newTags.Count == 0 && originalTags.Count == 0) return;
List<string> deleteTags = new List<string>();
List<string> addTags = new List<string>();