[ACS-9073] address review comments

This commit is contained in:
Manish Kumar
2025-01-23 17:34:54 +05:30
parent d64a8d83df
commit 87e1b407f4

View File

@@ -352,12 +352,15 @@ public class AlfrescoSolrHighlighter extends DefaultSolrHighlighter implements P
if (highlightFieldEntry.getValue() instanceof String[])
{
String [] snippets = (String[])highlightFieldEntry.getValue();
if (snippets.length > 0)
if (snippets != null && snippets.length > 0 && snippets[0] != null)
{
if (snippets[0].charAt(0) == '\u0000')
{
int pos = snippets[0].indexOf('\u0000',1);
snippets[0] = snippets[0].substring(pos + 1);
if(pos != -1)
{
snippets[0] = snippets[0].substring(pos + 1);
}
}
}
}