Added Try/Catch to keep the code from bombing on an invalid RO

This commit is contained in:
Rich 2012-04-11 18:12:18 +00:00
parent 0b0e62a2d7
commit d445039c7f

View File

@ -159,8 +159,17 @@ namespace Volian.Controls.Library
private string CreateRtf(bool colorLinks, string text, bool tableShouldBeOutlined, bool wordsShouldBeReplaced, bool numbersShouldBeFormated, bool tableHasBorder, bool ROsShouldBeAdjusted) private string CreateRtf(bool colorLinks, string text, bool tableShouldBeOutlined, bool wordsShouldBeReplaced, bool numbersShouldBeFormated, bool tableHasBorder, bool ROsShouldBeAdjusted)
{ {
// Adjust RO display // Adjust RO display
if (ROsShouldBeAdjusted) if (ROsShouldBeAdjusted)
text = DoROAdjustments(text); {
try // Added try/catch because an unresolved RO Link was causing a failure.
{
text = DoROAdjustments(text);
}
catch (Exception ex)
{
_MyLog.Error("DisplayText.CreateRTF Error doing DoROAdjustments", ex);
}
}
// if in print mode, view mode, or non-active richtextbox do replace words. Only if in // if in print mode, view mode, or non-active richtextbox do replace words. Only if in
// actual edit mode are replace words left as is. // actual edit mode are replace words left as is.
if (wordsShouldBeReplaced) if (wordsShouldBeReplaced)