diff options
| author | Craig Scott <craig.scott@crascit.com> | 2018-08-16 12:22:13 (GMT) |
|---|---|---|
| committer | Craig Scott <craig.scott@crascit.com> | 2018-08-16 12:22:13 (GMT) |
| commit | dbd3e2c53d2fb0c19a08a0fe8780df5eb4f89476 (patch) | |
| tree | 5464e19a76d6eab306a1140bb6abdb7e0c8e5e8a | |
| parent | b88bf6796e72691d4e7b5e5f0659734fc9f9089a (diff) | |
| download | CMake-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.cxx | 5 |
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) { |
