private ICmObject GetMatchObject()
{
try
{
return m_cache.ServiceLocator.GetObject(m_hvoMatch);
}
catch (KeyNotFoundException e)
{
}
// LT-13503 It is just possible that we are deleting the last remaining analysis of a wordform
m_hvoMatch = m_backupHvo;
if (m_hvoMatch <= 0)
{
return null;
}
var newTarget = m_cache.ServiceLocator.GetObject(m_hvoMatch);
var targetAsWordform = newTarget as IWfiWordform;
if (targetAsWordform != null && targetAsWordform.AnalysesOC.Count > 0)
{
InitializeConcordanceSearch(((IWfiWordform)newTarget).AnalysesOC.First());
}
else
{
InitializeConcordanceSearch(newTarget);
}
return newTarget;
}