From dbd3e2c53d2fb0c19a08a0fe8780df5eb4f89476 Mon Sep 17 00:00:00 2001 From: Craig Scott Date: Thu, 16 Aug 2018 22:22:13 +1000 Subject: EXPORT_PROPERTIES: Prevent null dereference for undefined property Fixes: #18260 --- Source/cmExportFileGenerator.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index 5f61571..9e6560f 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -1143,6 +1143,11 @@ bool cmExportFileGenerator::PopulateExportProperties( return false; } auto propertyValue = targetProperties.GetPropertyValue(prop); + if (propertyValue == nullptr) { + // Asked to export a property that isn't defined on the target. Do not + // consider this an error, there's just nothing to export. + continue; + } std::string evaluatedValue = cmGeneratorExpression::Preprocess( propertyValue, cmGeneratorExpression::StripAllGeneratorExpressions); if (evaluatedValue != propertyValue) { -- cgit v0.12