summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-04-11 14:33:35 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-04-11 14:33:48 (GMT)
commitded33659b150637b831291130b515803d6174722 (patch)
tree2f6876e7a4e6d484dee0bd8cb3506a6752745c82 /Source
parent952d72b79da982d8c099052ac474e04ab507cd17 (diff)
parent6f2701abf60bc8c0aeed14e09adf28d59023da87 (diff)
downloadCMake-ded33659b150637b831291130b515803d6174722.zip
CMake-ded33659b150637b831291130b515803d6174722.tar.gz
CMake-ded33659b150637b831291130b515803d6174722.tar.bz2
Merge topic 'cpack-trace-nullptr'
6f2701abf6 CPack: Fix crash on invalid generator name Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1950
Diffstat (limited to 'Source')
-rw-r--r--Source/CPack/cpack.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx
index 507a10c..b6ff38b 100644
--- a/Source/CPack/cpack.cxx
+++ b/Source/CPack/cpack.cxx
@@ -350,16 +350,16 @@ int main(int argc, char const* const* argv)
}
if (parsed) {
cpackGenerator = generators.NewGenerator(gen);
- if (!cpackGenerator) {
+ if (cpackGenerator) {
+ cpackGenerator->SetTrace(trace);
+ cpackGenerator->SetTraceExpand(traceExpand);
+ } else {
cmCPack_Log(&log, cmCPackLog::LOG_ERROR,
"Cannot initialize CPack generator: " << gen
<< std::endl);
parsed = 0;
}
- cpackGenerator->SetTrace(trace);
- cpackGenerator->SetTraceExpand(traceExpand);
-
if (parsed && !cpackGenerator->Initialize(gen, mf)) {
cmCPack_Log(&log, cmCPackLog::LOG_ERROR,
"Cannot initialize the generator " << gen