summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2018-08-16 12:22:13 (GMT)
committerCraig Scott <craig.scott@crascit.com>2018-08-16 12:22:13 (GMT)
commitdbd3e2c53d2fb0c19a08a0fe8780df5eb4f89476 (patch)
tree5464e19a76d6eab306a1140bb6abdb7e0c8e5e8a
parentb88bf6796e72691d4e7b5e5f0659734fc9f9089a (diff)
downloadCMake-dbd3e2c53d2fb0c19a08a0fe8780df5eb4f89476.zip
CMake-dbd3e2c53d2fb0c19a08a0fe8780df5eb4f89476.tar.gz
CMake-dbd3e2c53d2fb0c19a08a0fe8780df5eb4f89476.tar.bz2
EXPORT_PROPERTIES: Prevent null dereference for undefined property
Fixes: #18260
-rw-r--r--Source/cmExportFileGenerator.cxx5
1 files changed, 5 insertions, 0 deletions
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) {