cmGeneratorExpressionNode: Fix check to CMP0199

Avoid dereferencing nullptr.
This commit is contained in:
Tyler Yankee committed 2026-10-29 07:31:45 -04:00
1 parent 9325f204e5
commit b4e408d7d9
1 file changed
+3 -1
+3 -1
View File
@@ -3435,6 +3435,9 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode
return false;
}
cmLocalGenerator const* const lg = eval->Context.LG;
if (!eval->HeadTarget) {
return false;
}
switch (eval->HeadTarget->GetPolicyStatusCMP0199()) {
case cmPolicies::WARN:
if (lg->GetMakefile()->PolicyOptionalWarningEnabled(
@@ -3455,7 +3458,6 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode
}
CM_UNREACHABLE;
return false;
}();
if (oldPolicy) {