From 7d6a5e097f17720ed21fe5faac1759bf387c7880 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 2 Feb 2009 13:27:30 -0500 Subject: [PATCH] ENH: More robust property lookup This teaches cmMakefile::GetProperty and cmake::GetProperty methods to return NULL when the property name is NULL, making them more robust and consistent with the behavior of cmTarget::GetProperty. --- Source/cmMakefile.cxx | 4 ++++ Source/cmake.cxx | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index fabfd3596..870fd6f48 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -3162,6 +3162,10 @@ const char *cmMakefile::GetProperty(const char* prop) const char *cmMakefile::GetProperty(const char* prop, cmProperty::ScopeType scope) { + if(!prop) + { + return 0; + } // watch for specific properties static std::string output; output = ""; diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 1f7a7464b..10db0adc3 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -3606,6 +3606,10 @@ const char *cmake::GetProperty(const char* prop) const char *cmake::GetProperty(const char* prop, cmProperty::ScopeType scope) { + if(!prop) + { + return 0; + } bool chain = false; // watch for special properties