As rule binding could be null, we need to make sure to check that before checking for errors/warning (#2702)

…fore checking for any error/warnings.
This commit is contained in:
Shpakh-MSFT 2024-10-21 15:21:06 -07:00 коммит произвёл GitHub
Родитель 261c612eb3
Коммит c2297b1aed
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -3618,7 +3618,7 @@ namespace Microsoft.PowerFx.Core.Binding
// If the reference is to Control.Property and the rule for that Property is a constant,
// we need to mark the node as constant, and save the control info so we may look up the
// rule later.
if (controlInfo?.GetRule(property.InvariantName) is { HasErrorsOrWarnings: false } rule && rule.Binding != null && rule.Binding.IsConstant(rule.Binding.Top))
if (controlInfo?.GetRule(property.InvariantName) is IExternalRule rule && rule.Binding != null && !rule.HasErrorsOrWarnings && rule.Binding.IsConstant(rule.Binding.Top))
{
value = controlInfo;
isConstant = true;