1
0
Эх сурвалжийг харах

Merge topic 'no-source-language-crash'

2c2fbaf Do not crash on unknown source language (#13323)
David Cole 13 жил өмнө
parent
commit
e5ebb77405

+ 7 - 4
Source/cmLocalGenerator.cxx

@@ -2865,10 +2865,13 @@ cmLocalGenerator
     bool replaceExt = this->NeedBackwardsCompatibility(2, 4);
     if(!replaceExt)
       {
-      std::string repVar = "CMAKE_";
-      repVar += source.GetLanguage();
-      repVar += "_OUTPUT_EXTENSION_REPLACE";
-      replaceExt = this->Makefile->IsOn(repVar.c_str());
+      if(const char* lang = source.GetLanguage())
+        {
+        std::string repVar = "CMAKE_";
+        repVar += lang;
+        repVar += "_OUTPUT_EXTENSION_REPLACE";
+        replaceExt = this->Makefile->IsOn(repVar.c_str());
+        }
       }
 
     // Remove the source extension if it is to be replaced.