Fix error with missing columns in CTRL placeholder

This commit is contained in:
Jonathan Jenne 2021-10-19 16:31:45 +02:00
parent 1d5c577d2b
commit 235ce4818a

View File

@ -197,6 +197,8 @@ Public Class clsPatterns
oColumnName = oSplitName.Last()
End If
LOGGER.Debug("Found placeholder for control [{0}].", oControlName)
Dim oControl As Control = oPanel.Controls.Find(oControlName, False).FirstOrDefault()
If oControl IsNot Nothing Then
@ -233,13 +235,13 @@ Public Class clsPatterns
Where(Function(c) c.FieldName = oColumnName).
SingleOrDefault()
If oColumn Is Nothing Then
If oColumn?.SummaryItem?.SummaryValue Is Nothing Then
LOGGER.Warn("Column [{0}] not found in Grid!", oColumnName)
oReplaceValue = ERROR_REPLACE_VALUE
Else
oReplaceValue = oColumn.SummaryItem.SummaryValue
End If
oReplaceValue = oColumn.SummaryItem.SummaryValue
Case Else
oReplaceValue = ERROR_REPLACE_VALUE
End Select